Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ jobs:
# see https://github.com/microsoft/pyright/issues/10832
version: 1.1.403

stubdefaulter:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/[email protected]

- name: setup uv
uses: astral-sh/[email protected]
with:
python-version: "3.13"

# avoid stubdefaulter checking the tests as if they were stubs
- name: exclude tests
run: rm -rf tests

- name: stubdefaulter check
run: uv run stubdefaulter --check --exit-zero --packages .

# NOTE: mypy ignores `uv run --with=...` (and `--isolated` does not help), so we
# manually (re)install the desired version directly in the environment.

Expand Down Expand Up @@ -90,7 +108,6 @@ jobs:
run: stubtest --ignore-disjoint-bases --allowlist=.mypyignore scipy

typetest:
# needs: generate-matrix
runs-on: ubuntu-latest
timeout-minutes: 5

Expand Down
18 changes: 12 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@ type = [
"basedpyright==1.31.6",
"mypy[faster-cache]==1.18.2",
"pyrefly==0.35.0",
"stubdefaulter>=0.1.0",
]
dev = [
{ include-group = "lint" },
{ include-group = "type" },
]

# the required stubdefaulter features not released yet (>0.1.0)
[tool.uv.sources.stubdefaulter]
git = "https://github.com/JelleZijlstra/stubdefaulter.git"
rev = "ebe9e31"

[tool.poe.tasks.clean]
cmd = """
rm -rf
Expand All @@ -91,6 +97,10 @@ uv run
scipy
"""

[tool.poe.tasks.stubdefaulter]
cmd = "stubdefaulter --packages=. --exit-zero --check"
executor.type = "uv"

[tool.typos.files]
extend-exclude = ["*.pyi", ".mypyignore"]

Expand Down Expand Up @@ -232,12 +242,8 @@ runner = "uv-venv-lock-runner"
dependency_groups = ["type"]
uv_sync_flags = ["--no-editable", "--reinstall-package=scipy-stubs"]
commands = [
[
"stubtest",
"--ignore-disjoint-bases",
"--allowlist=.mypyignore",
{ replace = "posargs", default = ["scipy"], extend = true },
],
["stubtest", "--ignore-disjoint-bases", "--allowlist=.mypyignore", "scipy"],
["stubdefaulter", "--packages=.", "--exit-zero", "--check"],
]

[tool.tox.env.lint]
Expand Down
Loading