Skip to content

Fix precommit python version bug - #12

Merged
heyufan1995 merged 1 commit into
NVIDIA-Medtech:mainfrom
heyufan1995:main
Apr 13, 2026
Merged

Fix precommit python version bug#12
heyufan1995 merged 1 commit into
NVIDIA-Medtech:mainfrom
heyufan1995:main

Conversation

@heyufan1995

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: heyufan <heyufan1995@gmail.com>
@heyufan1995
heyufan1995 merged commit 4046a02 into NVIDIA-Medtech:main Apr 13, 2026
@greptile-apps

greptile-apps Bot commented Apr 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a pre-commit failure by removing a None | None expression (PEP 604 syntax requiring Python ≥ 3.10) from inside a Union[] annotation in typing.py, and updates both README environment setup instructions to match the py311 target already declared in pyproject.toml.

Confidence Score: 5/5

Safe to merge — targeted two-line fix with no logic changes and consistent documentation updates.

All three changes are correct and minimal: the None | None removal eliminates a genuine syntax incompatibility, and both README updates align docs with the existing py311 ruff target. No regressions introduced.

No files require special attention.

Important Files Changed

Filename Overview
NV-Segment-CTMR/brain_t1_preprocess/intensity_normalization/typing.py Removes redundant `None
NV-Segment-CTMR/docs/README.md Updates conda environment creation from python=3.9 to python=3.11, aligning with the target-version = "py311" already set in pyproject.toml.
NV-Segment-CT/docs/README.md Same Python version update (3.93.11) in the sister CT-module README, keeping both docs consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["ArgType definition\n(before)"] --> B["Union[Namespace, list[str], None | None]"]
    B --> C{"Python version?"}
    C -->|"3.9 — NoneType has no __or__"| D["TypeError at module load"]
    C -->|"3.10+ — PEP 604 supported"| E["Resolves to Union[Namespace, list[str], None]\n(redundant but valid)"]

    F["ArgType definition\n(after)"] --> G["Union[Namespace, list[str], None]"]
    G --> H["Valid on all targeted versions\n(py311, and backwards-compatible)"]
Loading

Reviews (1): Last reviewed commit: "Fix precommit python version bug" | Re-trigger Greptile

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