From e57e123e00f2c3a93d0bd06ac422e97db70964d8 Mon Sep 17 00:00:00 2001 From: BalconyJH Date: Fri, 10 Jan 2025 21:58:27 +0800 Subject: [PATCH] :green_heart: Fix ci --- .github/actions/setup-python/action.yml | 2 +- .github/workflows/pyright.yml | 11 ++--- pdm.lock | 53 ++++++++++++++++++++++++- pyproject.toml | 2 + 4 files changed, 59 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup-python/action.yml b/.github/actions/setup-python/action.yml index fa3df57..62130a4 100644 --- a/.github/actions/setup-python/action.yml +++ b/.github/actions/setup-python/action.yml @@ -50,7 +50,7 @@ runs: run: | cd ${{ inputs.env-dir }} - install_cmd="pdm install -g" + install_cmd="pdm install" if [ ! -z "${{ inputs.with-groups }}" ]; then IFS=',' read -ra groups <<< "${{ inputs.with-groups }}" diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yml index 0421d05..d002fa1 100644 --- a/.github/workflows/pyright.yml +++ b/.github/workflows/pyright.yml @@ -56,10 +56,7 @@ jobs: env-dir: "." - name: Run Pyright - uses: jakebailey/pyright-action@v2 - with: - python-version: ${{ matrix.python-version }} - python-platform: "Linux" - extra-args: >- - ${{ github.event.inputs.debug-mode == 'true' && '--warnings --verbose --level verbose' || '--warnings --verbose' }} - annotate: true \ No newline at end of file + shell: bash + run: | + extra_args="${{ github.event.inputs.debug-mode == 'true' && '--warnings --verbose --level verbose' || '--warnings --verbose' }}" + pdm run pyright . $extra_args \ No newline at end of file diff --git a/pdm.lock b/pdm.lock index f9900b2..9dbd399 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "test"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:6aa9e2c7c797c7382cf35b76cc24021512a88d0ed1d01c2d82cff0fed8b6f8c2" +content_hash = "sha256:ab88cd055766fe82f8ecaf303626f311382c31d05b36876c29984db7c5ce63a4" [[metadata.targets]] requires_python = ">=3.9" @@ -1030,6 +1030,26 @@ files = [ {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] +[[package]] +name = "nodejs-wheel-binaries" +version = "22.13.0" +requires_python = ">=3.7" +summary = "unoffical Node.js package" +groups = ["dev"] +dependencies = [ + "typing-extensions; python_version < \"3.8\"", +] +files = [ + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:646ab3e65296de9c578db9a1dcfbca26386d2ead70a49008f75d02e960593b2f"}, + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-macosx_11_0_x86_64.whl", hash = "sha256:38c689d556f428415a77655f70d2046ddbe11604039489f029b12f317042eaf4"}, + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:61885cbcfff0a6d40353c8ea3d861ccb65dba7ce4b19f22427719aeeb35d42f1"}, + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e358439ff830db766006e6eeb85ababb94b8c41c7325c9eb1f873a52d3df3016"}, + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1e26d39448cbb2969da10f5e62e53101591e4d6c6a6ae8d623c65f56bf28ce6b"}, + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-win_amd64.whl", hash = "sha256:cd9c6cdfd00ec48c55cbcd21a98af1fc9c2a18f039aede729de319346ed8675d"}, + {file = "nodejs_wheel_binaries-22.13.0-py2.py3-none-win_arm64.whl", hash = "sha256:aa8af75d30c3132bc4e998126a78b11c269abc3060f1c7c697907299b21ae0e1"}, + {file = "nodejs_wheel_binaries-22.13.0.tar.gz", hash = "sha256:dd811e3e5b92f2e5d4eb236cdf1ff814c91d3d3533d90d63b4af41d07a8bb2fc"}, +] + [[package]] name = "packaging" version = "24.2" @@ -1363,6 +1383,37 @@ files = [ {file = "pymdown_extensions-10.14.tar.gz", hash = "sha256:741bd7c4ff961ba40b7528d32284c53bc436b8b1645e8e37c3e57770b8700a34"}, ] +[[package]] +name = "pyright" +version = "1.1.391" +requires_python = ">=3.7" +summary = "Command line wrapper for pyright" +groups = ["dev"] +dependencies = [ + "nodeenv>=1.6.0", + "typing-extensions>=4.1", +] +files = [ + {file = "pyright-1.1.391-py3-none-any.whl", hash = "sha256:54fa186f8b3e8a55a44ebfa842636635688670c6896dcf6cf4a7fc75062f4d15"}, + {file = "pyright-1.1.391.tar.gz", hash = "sha256:66b2d42cdf5c3cbab05f2f4b76e8bec8aa78e679bfa0b6ad7b923d9e027cadb2"}, +] + +[[package]] +name = "pyright" +version = "1.1.391" +extras = ["nodejs"] +requires_python = ">=3.7" +summary = "Command line wrapper for pyright" +groups = ["dev"] +dependencies = [ + "nodejs-wheel-binaries", + "pyright==1.1.391", +] +files = [ + {file = "pyright-1.1.391-py3-none-any.whl", hash = "sha256:54fa186f8b3e8a55a44ebfa842636635688670c6896dcf6cf4a7fc75062f4d15"}, + {file = "pyright-1.1.391.tar.gz", hash = "sha256:66b2d42cdf5c3cbab05f2f4b76e8bec8aa78e679bfa0b6ad7b923d9e027cadb2"}, +] + [[package]] name = "pytest" version = "8.3.4" diff --git a/pyproject.toml b/pyproject.toml index ac3528c..a5b59fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,7 @@ keep-runtime-typing = true [tool.pyright] pythonVersion = "3.9" pythonPlatform = "All" +venv = ".venv" executionEnvironments = [ { root = "./tests", extraPaths = [ "./", @@ -92,6 +93,7 @@ test = [ "pytest-mock>=3.14.0", ] dev = [ + "pyright[nodejs]>=1.1.391", "ruff>=0.8", "pre-commit~=4.0", "bump-my-version>=0.28.1",