Skip to content

Commit

Permalink
Merge pull request #45 from jorenham/more-poe-tasks
Browse files Browse the repository at this point in the history
more poe tasks & CI typetesting
  • Loading branch information
jorenham authored Sep 8, 2024
2 parents 16052c4 + ec55b2f commit 56cd088
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
run: poe stubtest -- --concise
continue-on-error: true

- name: typetest
run: poe typetest

# TODO
# - uses: scientific-python/[email protected]
# with:
Expand Down
48 changes: 37 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,41 @@ pre-commit = "^3.8.0"
type = "poetry"

[tool.poe.tasks]
clean = """
rm -rf
scipy-stubs/**/*.pyc
scipy-stubs/**/__pycache__
./**/.mypy_cache
./**/.ruff_cache
"""

lint = "ruff check"
verifytypes = "basedpyright --ignoreexternal --verifytypes scipy-stubs"
format = "ruff format"

[tool.poe.tasks.stubtest]
cmd = "stubtest --mypy-config-file=pyproject.toml --allowlist=tests/stubtest/allowlist.txt $modules"
args = [
{name = "modules", positional = true, multiple = true, default = "scipy"},
]
_typetest_bpr = "basedpyright typetests"
_typetest_mypy = "mypy --config-file=pyproject.toml typetests"
typetest = ["_typetest_bpr", "_typetest_mypy"]

[tool.poe.tasks.pyright]
cmd = "basedpyright scipy-stubs/$path"
args = [{name = "path", positional = true, multiple = true, default = ""}]

[tool.poe.tasks.mypy]
cmd = "mypy --config-file=pyproject.toml scipy-stubs/$path"
args = [{name = "path", positional = true, multiple = true, default = ""}]

[tool.poe.tasks.verifytypes]
cmd = "basedpyright --ignoreexternal --verifytypes scipy-stubs/$path"
args = [{name = "path", positional = true, multiple = true, default = ""}]

[tool.poe.tasks.stubtest]
cmd = """
stubtest
--mypy-config-file=pyproject.toml
--allowlist=tests/stubtest/allowlist.txt
$modules
"""
args = [{name = "modules", positional = true, multiple = true, default = "scipy"}]

[tool.mypy]
python_version = "3.10"
Expand All @@ -68,15 +94,15 @@ warn_unused_ignores = true


[tool.pyright]
include = ["scipy-stubs"]
include = ["scipy-stubs", "typetests"]
exclude = [".cache"]
ignore = [".venv"]
pythonPlatform = "All"
pythonVersion = "3.10"
stubPath = "."
typeCheckingMode = "strict"
venv = ".venv"
venvPath = "."
stubPath = "."
pythonVersion = "3.10"
pythonPlatform = "All"
typeCheckingMode = "strict"

deprecateTypingAliases = true
enableTypeIgnoreComments = false
Expand Down

0 comments on commit 56cd088

Please sign in to comment.