Modernise tooling, packaging and static type checking - #24
Conversation
|
I was actually looking into pre-commit hooks to add and found this PR. Can this be merged? |
|
I used cookiecutter template to scaffold the project. Which is what I do for every Python project today. It sets up the pre commit hooks with static type checking, linting, formatting, ... Unfortunately I didnt finish this pull request. But if you want to pick it up, that would be great |
|
I see. Do you have a list of what you would like to put in this PR? |
|
I wanted to add pyproject.toml, and static code checkers, and then also have lint, type clean project. But this opened up a lot of issues in the code, so it will require some time to do it. If you want you can merge this even with type errors, and we can fix later. |
bc538ed to
0d9cdc3
Compare
- Replaced pylint + pip-based lint job with pre-commit (ruff lint/format) - Added test job with pytest across Python 3.10–3.13 matrix and Codecov upload - Replaced with (produces sdist + wheel) - Gated build job on check + test passing - Added pull_request trigger so checks run on PRs, not only on master/tags - Dropped deprecated from PyPI publish step
Pin uv to 0.11.24 for reproducible builds and add .dockerignore to prevent .venv, docs, dist and git metadata from being copied into the image.
7ab7500 to
f3d4844
Compare
SummaryThis branch migrates the project from Infrastructure & packaging
Type checking fixes (
|
| Location | Reason |
|---|---|
cast(str, super().type_name) |
systemrdl types type_name as str | None. The surrounding logic already guarantees it is set, but the type signature does not encode that |
cast(list[int], self.array_dimensions) |
array_dimensions is list[int] | None in systemrdl. The is_array guard makes None impossible here, but there is no type-level invariant linking the two |
cast(AddressableNode, N).current_idx |
cls = type(self) after an isinstance(self, AddressableNode) check — the narrowing does not flow through type(self)(...), so the constructed value is typed as HalBaseNode rather than HalBaseNode & AddressableNode |
Add modern Python environment.
Use ruff, ty for static code checking, automatic formatting, trailing whitespace...