-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
namespace packages take priority over setuptools PEP 660 editables in lenient mode #7782
Comments
@jrbourbeau I can't reproduce this, what are the values of |
Hmm I don't seem to be able to reproduce myself...I'll go ahead and close for now and re-open if this shows up again. Apologies for the noise. |
I can now reproduce this issue and have narrowed it down to the "lenient" setuptools PEP 660 mode |
__version__
and other attributes
pip install -e .Editable installs allow you to install your project without copying any files. Instead, the files in the development directory are added to Python’s import path. See https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs There are two different implementations of editable installs in pip, "legacy" setup.py develop and the current PEP 660 editable wheels. legacy setup.py develop editableswithout a
this causes the project directory to be added to the
this has the advantage of being very simple, however it also means that all the files and directories in the project dir become importable, not just the "distributed" package: eg
in addition this is legacy behaviour and the pip maintainers want to remove any direct calls to PEP 660Editable installs for pyproject.toml based builds defined by https://peps.python.org/pep-0660/ instead of calling a number of strategies are suggested in the PEP: https://peps.python.org/pep-0660/#what-to-put-in-the-wheel and setuptools implements three different approaches https://setuptools.pypa.io/en/latest/userguide/development_mode.html setuptools lenient mode"lenient" mode is the default behaviour. setuptools will use a .pth file to add a MetaPathFinder to sys.meta_path:
however this results in namespace packages on the current directory taking precedence over the installed editable package because setuptools compat mode"compat" mode is an optional mode enabled by running
this mode behaves almost the same as the legacy unfortunately this mode is considered deprecated and was scheduled to be removed December 2022 the official documentation for this mode is https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior setuptools strict mode"strict" mode is an optional mode enabled by running the official documentation for this mode is https://setuptools.pypa.io/en/latest/userguide/development_mode.html#strict-editable-installs |
There is no way to configure |
alternatively the build backend |
I have an editable version of
distributed
installed locally withpip install -e .
from the root of the repo. When I drop intoipython
I seeThis looks like I expect it to. When I then navigate to another directory, for example, over to the root of
dask/dask
on my laptop, I no longer see the samedistributed.__version__
anddistributed.__file__
:I've not run
git bisect
, but my guess is #7629 is relatedcc @graingert for visibility
The text was updated successfully, but these errors were encountered: