Sync the tree with current mypy and isort #4

Merged
Jan Lindemann merged 2 commits from jan/fix/20261113-sync-the-tree-with-current-mypy-and-isort into master 2026-11-13 15:20:34 +01:00 AGit
Owner

The toolchain moved on: mypy 2.4.0 flags the and check in __parse__() as unreachable, and the current isort rewrites two import lists on every make format run. The two commits keep make check and make format green without changing runtime behaviour:

Options.init(): Annotate __allowed_keys as Any

mypy 2.4.0 infers the attribute from the None assignment in __init__() and then flags the right operand of the and check in __parse__() as unreachable code, failing make check.

The attribute is only ever assigned None, so annotate it as Any and keep the runtime behaviour unchanged.

style: Sync import formatting with current isort

The current isort formats parenthesized import lists with a trailing comma and wraps long imports differently than when the files were last formatted, so make format rewrites them on every run even though nothing is wrong with the code.

Apply make format to the two drifted import statements so the tree matches the formatter's output and make format becomes a no-op:

  • src/python/jw/util/log.py: trailing comma in the jw.pkg.lib.log import list
  • src/python/jwutils/db/schema/CompositeForeignKey.py: wrap the CompositeForeignKey import in parentheses
The toolchain moved on: `mypy` 2.4.0 flags the `and` check in `__parse__()` as unreachable, and the current `isort` rewrites two import lists on every `make format` run. The two commits keep `make check` and `make format` green without changing runtime behaviour: #### Options.__init__(): Annotate __allowed_keys as Any `mypy` 2.4.0 infers the attribute from the `None` assignment in `__init__()` and then flags the right operand of the `and` check in `__parse__()` as unreachable code, failing `make check`. The attribute is only ever assigned None, so annotate it as Any and keep the runtime behaviour unchanged. #### style: Sync import formatting with current isort The current `isort` formats parenthesized import lists with a trailing comma and wraps long imports differently than when the files were last formatted, so `make format` rewrites them on every run even though nothing is wrong with the code. Apply `make format` to the two drifted import statements so the tree matches the formatter's output and `make format` becomes a no-op: - `src/python/jw/util/log.py`: trailing comma in the `jw.pkg.lib.log` import list - `src/python/jwutils/db/schema/CompositeForeignKey.py`: wrap the `CompositeForeignKey` import in parentheses
mypy 2.4.0 infers the attribute from the None assignment in __init__() and
then flags the right operand of the and check in __parse__() as unreachable
code, failing make check.

The attribute is only ever assigned None, so annotate it as Any and keep
the runtime behaviour unchanged.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.2
Signed-off-by: Jan Lindemann <jan@janware.com>
style: Sync import formatting with current isort
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m26s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m27s
CI / Packaging test (pull_request) Successful in 0s
71037e631a
The current isort formats parenthesized import lists with a trailing comma
and wraps long imports differently than when the files were last formatted,
so make format rewrites them on every run even though nothing is wrong with
the code.

Apply make format to the two drifted import statements so the tree matches
the formatter's output and make format becomes a no-op:

- src/python/jw/util/log.py: trailing comma in the jw.pkg.lib.log import
  list
- src/python/jwutils/db/schema/CompositeForeignKey.py: wrap the
  CompositeForeignKey import in parentheses

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.2
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-11-13 15:09:37 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-python!4
No description provided.