-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Inconsistent .mypy_cache for PyJWT library #10167
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
Comments
Do you have PyJWT installed in the environment where you mypy? If yes, do you have the same version of PyJWT installed in both environments? |
@JukkaL yes, |
@JukkaL any news regarding this? |
I did further digging and it turns out the discrepancies between files are caused by For some reason on CI |
Some ideas of what could you wrong in CI:
Maybe upgrading to mypy 0.901 will help as that doesn't ship third-party packages, so there should be no way for CI to pick up the stubs, unless the |
Thanks for checking this out! I have tried upgrading now and discovered a different problem: I installed types for 3rd parties as requested and everything runs smoothly, but I cannot convince
I get errors like |
Can you give the output of this fragment from your container:
Mypy looks for installed stub packages in these directories. |
Also
|
It looks like the problem is that you're installing to /artifacts/pip instead of either site-packages directory, which makes this the same issue as #5701. |
For posterity, just wanted to point out, in our scenario |
Closing, since there isn't a clear repro, and several things have changed that could potentially have fixed this |
Bug Report
.mypy_cache
files for PyJWT library are different in a CI docker container and locally.To Reproduce
Mypy check fails on the following line in the CI container:
with
Incompatible return value type (got "bytes", expected "str")
(line 4).I am not able to completely reproduce container setup, since it's done by our corporate internal tooling.
Expected Behavior
Cache files are generated consistently regardless env setup. I'm perplexed about why this could be happening since it's not even my project code, but an external library. And it's failing because of the lack of some stubs (
api_jwk
,api_jws
etc).Actual Behavior
docker:
locally:
Your Environment
--ignore-missing-imports
(but I tried with no flags, just-v
for verbose output)mypy.ini
(and other config files): no config fileThe text was updated successfully, but these errors were encountered: