-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Incremental parsing issue with namespace packages #12664
Comments
Thanks, I can repro on master, which means the unreleased #12250 does not fix either edit: this still repros as of 2022/10/28, so I guess #13124 didn't fix either (looks unrelated to the |
I'm getting the same issue. I'm running python 3.10.7, mypy 0.982, mypy-extensions 0.4.3, ruamel.yaml 0.17.21 and ruamel.yaml.clib 0.2.7 in a larger project. I followed the exact steps above to repro with a new virtual environment after
Python 3.10.7, Windows 11. |
Hitting the same issue. Do we know what causes this? |
The no incremental does not help with runamel.yaml because the final behavior of mypy depends on presence or absence of the optional binary dependency of it, When |
Related: python/mypy#12664 Related: python/mypy#8823
I can confirm this on Ubuntu 20.04.6 LTS, python 3.8.10, mypy 1.3.0. In my case the problem appears only in a package that depends on ruamel-yaml very indirectly (it's a dep of a dep of a dep), while in the original package that has the direct dependency and all others in the chain all seems OK, for now. I noted that the problematic package has a lot of Some more details:
|
I can confirm this issue on MacOS 14.1.2, python 3.11.6, mypy 1.7.1 |
Allow uploading a profile image that gets served / stored by recipeyak New flow for avatar urls is: 1. if upload is null, generate gravatar 2. if upload is not null, generate link to s3 not strictly related, but the new yaml package is surfacing a bug in mypy: python/mypy#12664
I can confirm this issue on MacOS 13.2.1, python 3.10.10, mypy 1.8.0 |
Similarly still seeing this issue on intermitant On
|
We are affected by this issue as well. Using We are using Poetry and this are the relevant versions from our poetry.lock:
I want to say that using mypy is very valuable to us, but this is a small annoyance. Is there a workaround that works with the cache? |
Likely not relevant, but this does not ever appear to happen with It's also not deterministic, but I can confirm the behavior where it always succeeds when the cache is empty. |
after a year, this issue is still haunting me and costing me a significant amount of CI running time |
Given a local file which uses something which is a namespace package and then another local file which uses the first one, there's an intermittent bug where the namespace packaged module's types aren't found.
This seems likely similar to #7276, however even with #10937 in place (i.e: on a more recent mypy release) the issue remains.
To Reproduce
Subsequent runs will alternate between success and failure. Any additional source files in the project (whether they import the
wrapper
or not) will also have the error message applied to them, which makes failing runs vastly less useful.Running with
--no-incremental
appears to avoid the issue; I can run several times in a row with--no-incremental
without encountering the failure mode (and have not seen it with that flag enabled).Running with
--namespace-packages
appears to have no effect.Unfortunately as
ruamel.yaml
is a typed library, ignoring the imports withtype: ignore[import]
ends up generating more errors as the ignores appear unused on a "successful" run (and you havewarn_unused_ignores
enabled).Setup & versions
python3.9 -m venv venv . venv/bin/activate pip install -U pip setuptools wheel pip install mypy ruamel.yaml
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: