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, acting different. #1415

Closed
janiversen opened this issue Mar 9, 2023 · 4 comments
Closed

mypy, acting different. #1415

janiversen opened this issue Mar 9, 2023 · 4 comments

Comments

@janiversen
Copy link
Collaborator

In pull request #1413 mypy is behaving differently in CI vs. ./check_ci.sh

./check_ci.sh do not report any problems, but mypy in the CI reports:
Captura de pantalla 2023-03-09 a las 15 22 01

It would be nice if the checks could be identical.

@alexrudd2
Copy link
Collaborator

Hmm, the CI is correct. I'll see if I can checkout the PR branch and reproduce. Sometimes mypy caches in a way I don't fully understand.

@janiversen
Copy link
Collaborator Author

Be aware that I corrected those 2 lines in the pr.

You can simply change List to list, in those 2 lines and test.

You can run CI on a branch.

@alexrudd2
Copy link
Collaborator

OK, figured it out.

https://peps.python.org/pep-0585/

list[int] only works on Python3.9+. List[int] works on all versions, including 3.8.

If you want check_ci.sh to function identically to the CI, it should be changed to python3.8 -m mypy pymodbus

@janiversen
Copy link
Collaborator Author

Which would require having 3.8 installed, so lets not make that change.

I was actually looking to understand why, and you have explained it very nicely, thanks a lot.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants