Open
Description
Description
I am starting to observe broken editable installs since past week.
Specifically, editable install now creates a __editable__.<pkg>.pth
and __editable___<pkg>_finder.py
files. These paths are returned as part of namespace.__path__
, which has broken a lot of tooling.
pdoc3
went broke. Skipping__editable__
package seems to fix (hack) it.- We also noticed, namespace packages that installs a CLI are now also broken, because while the binary is under
.venv/bin
, it is unable to import the modules since it was installed using-e
.- Modifying
PYTHONPATH
is the only option.
- Modifying
- We also noticed, due to these changes even VSCode/Pylance is now broken, as it is unable to resolve paths to editable installed packages.
- Adding
"python.analysis.extraPaths"
to.vscode/settings.json
is the way out
- Adding
I was unable to find any search result on Google for __editable__
and __path_hook__
. So, I am unsure what I am up against here.
Expected behavior
- Installed CLI from namespace package must work fine without modification of
PYTHONPATH
namespace.__path__
must return actual path instead of__editable__.*
which seems to break a lot of existing tooling
pip version
22.2.2
Python version
3.10.5
OS
MacOS 12.5
How to Reproduce
- Create a namespace package that installs CLI (entry point)
- Install the package with
-e
- Installed CLI is broken due to missing
PYTHONPATH
Our projects are using pyproject.toml
and setup.cfg
.
Output
`ImportError: cannot import name 'entry_point' from 'namespace.cli' (unknown location)`
Code of Conduct
- I agree to follow the PSF Code of Conduct.