-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 error when running nox on Windows #11560
Comments
Interesting. We don't run mypy on Windows in CI, and I don't develop on
Windows.
I'm not sure what the right way to handle this is. This function doesn't
run on Windows, but I'm not sure how to tell mypy that...
…On Sat, Sep 7, 2024 at 6:53 AM Quentin Retourne ***@***.***> wrote:
I don't know if we're supposed to do so, but I'm trying to run the nox -e
local command on Windows.
When creating a venv, installing uv on it then running the command, I'm
getting the following error:
nox > mypy src/cryptography/ vectors/cryptography_vectors/ tests/ release.py noxfile.py
tests\hazmat\primitives\test_ciphers.py:258: error: Unexpected keyword argument "prot" for "mmap" [call-arg]
tests\hazmat\primitives\test_ciphers.py:258: error: Module has no attribute "PROT_READ" [attr-defined]
.nox\local\Lib\site-packages\mypy\typeshed\stdlib\mmap.pyi:35: note: "mmap" defined here
tests\hazmat\primitives\test_aead.py:41: error: Unexpected keyword argument "prot" for "mmap" [call-arg]
tests\hazmat\primitives\test_aead.py:41: error: Module has no attribute "PROT_READ" [attr-defined]
.nox\local\Lib\site-packages\mypy\typeshed\stdlib\mmap.pyi:35: note: "mmap" defined here
Found 4 errors in 2 files (checked 202 source files)
nox > Command mypy src/cryptography/ vectors/cryptography_vectors/ tests/ release.py noxfile.py failed with exit code 1
nox > Session local failed.
The local environment is on python 3.12.5 and mypy 1.12.5.
Right now, I've corrected it by placing a # type: ignore on problematic
files, is there any other way to do so?
—
Reply to this email directly, view it on GitHub
<#11560>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBD3O7LQERMIWQWOPNDZVLLKPAVCNFSM6AAAAABNZ5PY2KVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUYTCNJZGMYTEMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
I'll check this out and try to provide a fix telling mypy to ignore these kind of warnings for windows :) |
As per mypy documentation, , the following fix could be something like this:
I'm opening a mini PR on the subject; it might hurt coverage though. |
With integration of #11570, the issue is fixed. Closing! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know if we're supposed to do so, but I'm trying to run the
nox -e local
command on Windows.When creating a venv, installing uv on it then running the command, I'm getting the following error:
The
local
environment is on python 3.12.5 and mypy 1.12.5.Right now, I've corrected it by placing a
# type: ignore
on problematic files, is there any other way to do so?The text was updated successfully, but these errors were encountered: