From 6dc67050595ca51418c1fba1f13cd4c644d41927 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Sun, 1 Sep 2024 21:03:13 +0900 Subject: [PATCH] test: add real-package tests --- .github/workflows/rust.yml | 1 - .github/workflows/test.yml | 71 ++++++++++++++++++++++++++++++++++++++ Cargo.lock | 20 +++++------ Cargo.toml | 6 ++-- docs/options/options.md | 17 +++++++++ 5 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 835f0fd..5ca05d9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,7 +31,6 @@ jobs: steps: - uses: actions/checkout@v2 - # installing pylyzer itself is required for the tests - name: Build run: | rustup update stable diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7c587c1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,71 @@ +name: Test + +on: + push: + branches: [main] + paths-ignore: + - "docs/**" + - "images/**" + - "**.md" + - "**.yml" + - "LICENSE-**" + - ".gitmessage" + - ".pre-commit-config.yaml" + pull_request: + branches: [main] + paths-ignore: + - "docs/**" + - "images/**" + - "**.md" + - "**.yml" + - "LICENSE-**" + - ".pre-commit-config.yaml" + +env: + CARGO_TERM_COLOR: always + +jobs: + package-test: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + - name: Install + run: | + rustup update stable + cargo install --path . + - name: boto3 + run: | + pip3 install boto3 + pylyzer -c "import boto3" + echo "OK: boto3" + - name: urllib3 + run: | + pip3 install urllib3 + pylyzer -c "import urllib3" + echo "OK: urllib3" + - name: setuptools + run: | + pip3 install setuptools + pylyzer -c "import setuptools" + echo "OK: setuptools" + - name: requests + run: | + pip3 install requests + pylyzer -c "import requests" + echo "OK: requests" + - name: certifi + run: | + pip3 install certifi + pylyzer -c "import certifi" + echo "OK: certifi" + - name: charset-normalizer + run: | + pip3 install charset-normalizer + pylyzer -c "import charset_normalizer" + echo "OK: charset-normalizer" + - name: idna + run: | + pip3 install idna + pylyzer -c "import idna" + echo "OK: idna" diff --git a/Cargo.lock b/Cargo.lock index e8e4f69..1d812e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,9 +145,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "els" -version = "0.1.54-nightly.5" +version = "0.1.55-nightly.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdc6282121d9e2871553e0731cfb88119cbfe76ce8aab08ac2be01f5644e3bee" +checksum = "53cd4fb020c2357f6710be6e23a9a6b62fbf43c91ad2121d20f1afd0cde82a40" dependencies = [ "erg_common", "erg_compiler", @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "erg_common" -version = "0.6.42-nightly.5" +version = "0.6.43-nightly.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0dfc622cc65f230a05a284a21f62c8f4a3c964c51c97881cc4e01202ef2a3c0" +checksum = "2a59a52380300a8cd0e73c400d6568b80ccced5a55076c1e28fa2f28fda980d0" dependencies = [ "backtrace-on-stack-overflow", "erg_proc_macros", @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "erg_compiler" -version = "0.6.42-nightly.5" +version = "0.6.43-nightly.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42247c4ab1eb33ed3e2e9e74f4773565eba4491f76bfbda4b965015938704ca1" +checksum = "98ba16deaf1fe89b180453da6fe28471869502ffd289ef8996ef935f6151ef63" dependencies = [ "erg_common", "erg_parser", @@ -181,9 +181,9 @@ dependencies = [ [[package]] name = "erg_parser" -version = "0.6.42-nightly.5" +version = "0.6.43-nightly.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c921c178517c2071e45418e8c5b35e0c3a19021e4459283fd8f6997b89ba216" +checksum = "f42d83ee9069552150616e49fa5fa7ea08da8aebee7837b843161ce484d42adc" dependencies = [ "erg_common", "erg_proc_macros", @@ -192,9 +192,9 @@ dependencies = [ [[package]] name = "erg_proc_macros" -version = "0.6.42-nightly.5" +version = "0.6.43-nightly.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1381ca7a7a0781834cb1d617cd8361cca23f880cb9c515d249905d585832734" +checksum = "b8c49d659d539d72b99227ea870f0c1f5b30fb5c7cbc944931363f4dd4b26028" dependencies = [ "quote", "syn 1.0.109", diff --git a/Cargo.toml b/Cargo.toml index ceb75b2..46ef2d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,9 @@ edition = "2021" repository = "https://github.com/mtshiba/pylyzer" [workspace.dependencies] -erg_common = { version = "0.6.42-nightly.5", features = ["py_compat", "els"] } -erg_compiler = { version = "0.6.42-nightly.5", features = ["py_compat", "els"] } -els = { version = "0.1.54-nightly.5", features = ["py_compat"] } +erg_common = { version = "0.6.43-nightly.1", features = ["py_compat", "els"] } +erg_compiler = { version = "0.6.43-nightly.1", features = ["py_compat", "els"] } +els = { version = "0.1.55-nightly.1", features = ["py_compat"] } # rustpython-parser = { version = "0.3.0", features = ["all-nodes-with-ranges", "location"] } # rustpython-ast = { version = "0.3.0", features = ["all-nodes-with-ranges", "location"] } rustpython-parser = { git = "https://github.com/RustPython/Parser", version = "0.4.0", features = ["all-nodes-with-ranges", "location"] } diff --git a/docs/options/options.md b/docs/options/options.md index 93b5f6d..be8bd98 100644 --- a/docs/options/options.md +++ b/docs/options/options.md @@ -26,3 +26,20 @@ $ pylyzer -c "print('hello world')" Start checking: string All checks OK: string ``` + +## --disable + +Disable a default LSP feature. +Default (disableable) features are: + +* codeAction +* codeLens +* completion +* diagnostics +* findReferences +* gotoDefinition +* hover +* inlayHint +* rename +* semanticTokens +* signatureHelp