Skip to content

Commit 519f38f

Browse files
committed
ci: enforce ty checks
The rules demoted for the migration are back at their default level and the allow-list names the actual dependencies, so an unresolved import from a new package is reported rather than ignored.
1 parent f7df3f2 commit 519f38f

3 files changed

Lines changed: 42 additions & 18 deletions

File tree

.github/workflows/ci-tests.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16+
lint:
17+
name: "Lint and type check"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v7
21+
22+
- uses: prefix-dev/setup-pixi@v0.10.0
23+
with:
24+
pixi-version: v0.62.2
25+
cache: true
26+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
27+
frozen: true
28+
# py312 is not linted itself: it is the environment the `ty` hook
29+
# resolves third-party types against. Installing it here rather than
30+
# in a separate step keeps it inside setup-pixi's cache.
31+
environments: lint py312
32+
33+
- name: Run lint hooks
34+
run: pixi run -e lint lint
35+
env:
36+
SKIP: no-commit-to-branch
37+
1638
test-python:
1739
name: "Tests Python (${{ matrix.environment }}, ${{ matrix.os }})"
1840
runs-on: ${{ matrix.os }}

pixi.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,25 @@ docstring-code-line-length = 88
164164
[tool.ty]
165165

166166
[tool.ty.analysis]
167-
# Keep optional and external imports equivalent to mypy's ignore_missing_imports.
168-
# Narrowed to the actual dependency list once the findings are cleared.
169-
allowed-unresolved-imports = ["**"]
167+
# Permit unresolved imports from optional and external dependencies.
168+
allowed-unresolved-imports = [
169+
"maketables.**",
170+
"matplotlib.**",
171+
"pandas.**",
172+
"numpy.**",
173+
"scipy.**",
174+
"seaborn.**",
175+
"numba.**",
176+
"torch.**",
177+
"rpy2.**",
178+
"lets_plot.**",
179+
"formulaic.**",
180+
"wildboottest.**",
181+
"tabulate.**",
182+
"joblib.**",
183+
"narwhals.**",
184+
"tqdm.**",
185+
]
170186

171187
[tool.ty.environment]
172188
# Check against the oldest supported interpreter, even though the `ty` hook
@@ -177,22 +193,8 @@ python-version = "3.10"
177193
include = ["pyfixest"]
178194

179195
[tool.ty.terminal]
180-
error-on-warning = false
181196
output-format = "concise"
182197

183-
[tool.ty.rules]
184-
# ty's default rules are stricter than the existing mypy baseline. Report the
185-
# current compatibility findings as warnings while they are migrated.
186-
call-non-callable = "warn"
187-
invalid-argument-type = "warn"
188-
invalid-assignment = "warn"
189-
invalid-return-type = "warn"
190-
no-matching-overload = "warn"
191-
not-iterable = "warn"
192-
not-subscriptable = "warn"
193-
unresolved-attribute = "warn"
194-
unsupported-operator = "warn"
195-
196198
# --------------------------------------------------------------------------------------
197199
# pixi configuration
198200
# --------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)