Skip to content

Widen the ruff rule set, check tests with ty, bump the lint pins - #95

Merged
pattonw merged 5 commits into
mainfrom
chore/ruff-ty-baseline
Nov 4, 2026
Merged

pattonw merged 5 commits into
mainfrom
chore/ruff-ty-baseline

Conversation

@pattonw

@pattonw pattonw commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

ruff

[tool.ruff.lint] selects E, F, W, I, UP, B (was E4, E7, E9, F, I), ignores E501, allows E402 in tutorials/examples and F401 in __init__.py. The findings were 11 zip calls without explicit strict= (now strict=False), 8 unused loop variables (renamed _x), one deprecated typing import and one printf string; all applied by ruff check --fix plus ruff format on two files.

ty

[tool.ty.src] now lists daisy-py/python/daisy and tests explicitly, and the lint job runs a bare ty check, so CI and contributors run the same command and the tests are checked too. The tests/daisy_compat exclusion is gone: that directory checks clean. The lint group moves to ruff==0.17.3 and ty==0.0.96 (uv.lock updated). Three test diagnostics fixed: an unused ty: ignore in test_resources.py, a recorder whose finish is None until the run ends (annotated, asserted before use), and a helper whose context keyword was annotated optional but never is. unresolved-import stays ignored, as before, until the lint group can see numpy and rich.

Counters: 1 rule at ignore (unchanged), 0 ty: ignore comments, 0 excludes.

Verified locally

uv run --only-group lint ruff check ., ruff format --check . and ty check all clean; the two touched test files pass.

🤖 Generated with Claude Code

pattonw and others added 5 commits November 3, 2026 15:13
No workflow ran pytest: lint.yaml, docs.yml and publish.yaml cover
style, docs and wheels, and the only executed check of library
behaviour was the one-task smoke script in publish.yaml.

- tests.yaml: pull requests, pushes to main and manual dispatch; matrix
  is the requires-python floor and newest (3.11, 3.14) x
  highest/lowest-direct; stable Rust toolchain and cargo cache for the
  maturin build; setup-uv@v6 pins the interpreter; `uv run pytest
  --cov=daisy` with term-missing and xml reports.
- pyproject: numpy>=2 (tests/test_skip_mask.py imports it at module
  level, so a plain `uv sync && uv run pytest` errored at collection)
  and pytest-cov>=6 in the dev group; `testpaths = ["tests"]` so a bare
  `pytest` does not collect examples/stress_test.py, which runs a
  35 000-block pipeline at import.
- uv.lock updated for the two additions.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
test_block_function_gets_real_parallelism and
test_inline_zero_arg_worker_gets_real_parallelism compare wall time
across worker counts. On an idle multi-core machine they measure 3x and
more; on GitHub's shared runners the first CI run measured 1.1x-1.5x on
all four matrix jobs, clearing neither gate while staying far from the
~0.6x GIL-serialized regression they guard against. They still run
locally; on CI (CI=true) they are skipped with that reason.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
[tool.ruff.lint] now selects E, F, W, I, UP and B (E501 left to the
formatter), with E402 allowed in tutorials/examples and F401 in
__init__.py. The rest of this commit is `ruff check --fix` (plus the
semantics-preserving unsafe fixes for `zip(strict=False)`, `X | None`
annotations and printf formatting) and `ruff format`.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
[tool.ty.src] now lists the package and tests explicitly and the lint
job runs a bare `ty check`, so CI and contributors run the same
command. The tests/daisy_compat exclusion is gone: that directory
checks clean. ruff moves to 0.17.3 and ty to 0.0.96 in the lint group
(uv.lock updated). Three test diagnostics fixed: an unused `ty: ignore`
in test_resources.py, a recorder whose `finish` is None until the run
ends (annotated, asserted before use) and a helper whose `context`
keyword was annotated as optional but never is.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
main carries the squash of #94; this branch had the same changes as
separate commits, so pyproject.toml and uv.lock conflicted trivially.
Resolved to this branch's versions (main's content plus the lint pins)
and re-locked.
@pattonw
pattonw merged commit 0a006a6 into main Nov 4, 2026
16 checks passed
@pattonw
pattonw deleted the chore/ruff-ty-baseline branch November 4, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant