Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy checks fail on case-insensitive filesystem #47

Closed
SteVwonder opened this issue Aug 10, 2021 · 2 comments
Closed

mypy checks fail on case-insensitive filesystem #47

SteVwonder opened this issue Aug 10, 2021 · 2 comments

Comments

@SteVwonder
Copy link
Contributor

The case insensitivity means that an unintentional alias is created for the Job class since psi/j/Job.py and psi/j/job.py seemingly both exist.

(.venv-vscode-focal)  fluxuser@1f7fe27de5f4:/workspaces/psi-j-python$ make typecheck
mypy --config-file=.mypy --strict src tests
src/psi/j/Job.py:117: error: Argument 1 to "cancel" of "JobExecutor" has incompatible type "psi.j.Job.Job"; expected "psi.j.job.Job"
(.venv-vscode-focal)  fluxuser@1f7fe27de5f4:/workspaces/psi-j-python$ mypy --version
mypy 0.910

The impact here is that mypy checks will fail on any mac that has a case insensitive filesystem and windows machines. I also suspect that runtime can be impacted by this (e.g., import psi.j.Job - should that import the "Job.py" file or the Job class exposed by psi.j).

@SteVwonder
Copy link
Contributor Author

SteVwonder commented Aug 10, 2021

Two solutions that I'm aware of would be to either rename the Job class or rename psi/j/job.py to something else, maybe psi/j/job_class.py. If we rename the file, you can still import/reference the Job class as psi.j.Job since the psi/j/init.py exports it.

@hategan
Copy link
Collaborator

hategan commented Jan 18, 2023

There appear to be issues in general with python imports and mypy when running on code that is on case-insensitive file systems. Since the type correctness of the psi/j code can be verified on other systems, I do not believe that we gain much by adding workarounds to actual bugs (or regressions; see python/mypy#1961) in mypy.

@hategan hategan closed this as completed Jan 18, 2023
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

No branches or pull requests

2 participants