You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #10633, since the changes for modular typeshed, mypy doesn't seem to pick-up type packages explicitly installed with the GNU Guix package manager (https://guix.gnu.org).
Case in point I can install types-requests using Guix - for reference I used the following package definiton (derivied straight from guix import pypi types-requests):
If I look at the site-packages structure I can see both modules installed just like in the case when using a venv and pip install. A requests-stubs directory is present:
Everything looks the same as the venv equivalent apart from the obvious:
Guix softlinks the actual packages
Guix sets the mtime to 01/01/70 for every file
Looking at the verbose output I can see that stubs under here are found: /gnu/store/kpv69xmyaab5wql7rn2pqq4666zzhpvc-python-mypy-0.910/lib/python3.8/site-packages/mypy/typeshed/stdlib/
But it ignores the stubs softlinked under: requests-stubs -> /gnu/store/lgn23rxb63sl54i4px4lrrns3mv40jnn-python-types-requests-2.25.11/lib/python3.8/site-packages/requests-stubs
End of the log looks like this:
LOG: Metadata fresh for posixpath: file /gnu/store/kpv69xmyaab5wql7rn2pqq4666zzhpvc-python-mypy-0.910/lib/python3.8/site-packages/mypy/typeshed/stdlib/posixpath.pyiLOG: Metadata fresh for genericpath: file /gnu/store/kpv69xmyaab5wql7rn2pqq4666zzhpvc-python-mypy-0.910/lib/python3.8/site-packages/mypy/typeshed/stdlib/genericpath.pyiLOG: Loaded graph with 47 nodes (0.054 sec)LOG: Found 24 SCCs; largest has 24 nodesLOG: Processing 23 queued fresh SCCsLOG: Processing SCC singleton (src.dss.dss_api) as inherently stalesrc/dss/dss_api.py:4: error: Library stubs not installed for "requests" (or incompatible with Python 3.6) import requests ^src/dss/dss_api.py:4: note: Hint: "python3 -m pip install types-requests"src/dss/dss_api.py:4: note: (or run "mypy --install-types" to install all missing stub packages)src/dss/dss_api.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-importssrc/dss/dss_api.py:11: error: Library stubs not installed for "requests.adapters" (or incompatible with Python 3.6)
Pitch
Identify what is making the current implementation ignore walking the softlinked stub directories under Guix and include them.
In the meantime offer any workaround we could employ?
For example I've tried exporting MYPYPATH to the absolute directory targeted by the requests-stubs softlink as according to the docs this should then include that directory in the search path for stubs - but it doesn't seem to work.
One final option would be to allow us to include all stubs at build-time in the mypy package via a switch - then we could just build the old-style package?
The text was updated successfully, but these errors were encountered:
I've never heard of Guix, but it seems like Nix. I know that the Nix folks have figured out how to run mypy with the symlinked environment like you have, so I might suggest reporting this to Guix and seeing what Nix does.
Uh oh!
There was an error while loading. Please reload this page.
Feature
Similar to #10633, since the changes for modular typeshed, mypy doesn't seem to pick-up type packages explicitly installed with the GNU Guix package manager (https://guix.gnu.org).
Case in point I can install types-requests using Guix - for reference I used the following package definiton (derivied straight from
guix import pypi types-requests
):I can then install that in an environment with mypy 0910:
guix environment --ad-hoc python-mypy python-types-requests
If I look at the site-packages structure I can see both modules installed just like in the case when using a venv and
pip install
. Arequests-stubs
directory is present:Everything looks the same as the venv equivalent apart from the obvious:
Looking at the verbose output I can see that stubs under here are found:
/gnu/store/kpv69xmyaab5wql7rn2pqq4666zzhpvc-python-mypy-0.910/lib/python3.8/site-packages/mypy/typeshed/stdlib/
But it ignores the stubs softlinked under:
requests-stubs -> /gnu/store/lgn23rxb63sl54i4px4lrrns3mv40jnn-python-types-requests-2.25.11/lib/python3.8/site-packages/requests-stubs
End of the log looks like this:
Pitch
Identify what is making the current implementation ignore walking the softlinked stub directories under Guix and include them.
In the meantime offer any workaround we could employ?
For example I've tried exporting
MYPYPATH
to the absolute directory targeted by therequests-stubs
softlink as according to the docs this should then include that directory in the search path for stubs - but it doesn't seem to work.One final option would be to allow us to include all stubs at build-time in the mypy package via a switch - then we could just build the old-style package?
The text was updated successfully, but these errors were encountered: