From 80f8cf21ab8db12a999f8ac90f000773cda34e63 Mon Sep 17 00:00:00 2001 From: jorenham Date: Wed, 4 Sep 2024 23:23:16 +0200 Subject: [PATCH 1/3] add `poe` commands --- .github/workflows/ci.yml | 3 ++- pyproject.toml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54b636e5..f19b03b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,8 @@ jobs: # TODO: don't continue on error - name: basedmypy stubtest - run: poetry run stubtest --concise --ignore-positional-only --mypy-config-file=pyproject.toml --allowlist=tests/stubtest/allowlist.txt scipy + # run: poetry run stubtest --concise --ignore-positional-only --mypy-config-file=pyproject.toml --allowlist=tests/stubtest/allowlist.txt scipy + run: poetry run poe stubtest -- --concise continue-on-error: true # TODO diff --git a/pyproject.toml b/pyproject.toml index cb82f7c4..8399077b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,7 @@ build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] + [tool.poetry] authors = ["Joren Hammudoglu "] classifiers = [ @@ -42,6 +43,21 @@ ruff = "^0.6.3" poethepoet = "^0.28.0" pre-commit = "^3.8.0" +[tool.poe.executor] +type = "poetry" + +[tool.poe.tasks] +lint = "ruff check" +# stubtest = "stubtest --ignore-positional-only --mypy-config-file=pyproject.toml --allowlist=tests/stubtest/allowlist.txt scipy" +verifytypes = "basedpyright --level error --verifytypes scipy-stubs" + +[tool.poe.tasks.stubtest] +cmd = "stubtest --ignore-positional-only --mypy-config-file=pyproject.toml --allowlist=tests/stubtest/allowlist.txt $modules" +args = [ + {name = "modules", positional = true, multiple = true, default = "scipy"}, +] + + [tool.mypy] disable_bytearray_promotion = true disable_memoryview_promotion = true @@ -50,6 +66,7 @@ disallow_untyped_defs = false # TODO disallow_incomplete_defs = false # TODO warn_unused_ignores = true + [tool.pyright] include = ["scipy-stubs"] exclude = [".cache"] @@ -69,6 +86,7 @@ reportPrivateUsage = false reportUnnecessaryTypeIgnoreComment = true reportUnsafeMultipleInheritance = true + [tool.ruff] builtins = ["reveal_locals", "reveal_type"] exclude = ["scipy-pyright", ".venv"] From 2e49aaf9fe8dbfc12b640f800b251843175b2710 Mon Sep 17 00:00:00 2001 From: jorenham Date: Wed, 4 Sep 2024 23:32:54 +0200 Subject: [PATCH 2/3] fix `poe` CI command --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f19b03b3..ff7af84b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: install poetry run: | - pipx install poetry + pipx install poetry poe poetry config virtualenvs.create true --local poetry config virtualenvs.in-project true --local @@ -51,9 +51,9 @@ jobs: continue-on-error: true # TODO: don't continue on error - - name: basedmypy stubtest + - name: mypy.stubtest (based) # run: poetry run stubtest --concise --ignore-positional-only --mypy-config-file=pyproject.toml --allowlist=tests/stubtest/allowlist.txt scipy - run: poetry run poe stubtest -- --concise + run: poe stubtest -- --concise continue-on-error: true # TODO From 2a8d05f98f0f3432b65f7a6518e9a482aa5765b1 Mon Sep 17 00:00:00 2001 From: jorenham Date: Wed, 4 Sep 2024 23:34:31 +0200 Subject: [PATCH 3/3] use correct `poethepoet` package when installing in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff7af84b..e51e41db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: install poetry run: | - pipx install poetry poe + pipx install poetry poethepoet poetry config virtualenvs.create true --local poetry config virtualenvs.in-project true --local