setuptools: [BUG] recent versions of setuptools broke editable mode
setuptools version
65.2
Python version
3.9.13
OS
Ubuntu
Additional environment information
No response
Description
Since some recent releases (likely 64, when PEP-660 was implemented), installing psycopg with -e results in a broken package, where psycopg
is an empty namespace.
This is an example of broken run. This is a similar run whose difference is installing psycopg
without the -e
flag, in order to test a depending package.
Expected behavior
See above
How to Reproduce
A more complete reproduction with stable git reference can be found in https://github.com/tox-dev/tox/issues/2479.
Output
See above
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 6
- Comments: 20 (9 by maintainers)
Commits related to this issue
- ci: don't install modules in editable mode to run packages test Something else that broke after setuptools 64 release. See tox-dev/tox#2479 for more details. Reported something at pypa/setuptools#35... — committed to psycopg/psycopg by dvarrazzo 2 years ago
- ci: don't install modules in editable mode to run packages test Something else that broke after setuptools 64 release. See tox-dev/tox#2479 for more details. Reported something at pypa/setuptools#35... — committed to psycopg/psycopg by dvarrazzo 2 years ago
- CI: Work around setuptools editable install bug https://github.com/pypa/setuptools/issues/3557 — committed to VIDA-NYU/reprozip by remram44 a year ago
- CI: Work around setuptools editable install bug https://github.com/pypa/setuptools/issues/3557 — committed to VIDA-NYU/reprozip by remram44 a year ago
- CI: Work around setuptools editable install bug https://github.com/pypa/setuptools/issues/3557 — committed to VIDA-NYU/reprozip by remram44 a year ago
@abravalheri I have reported a regression. Things were working previously and now they don’t. I appreciate the hard work behind the hard problem of packaging, don’t get me wrong. Regressions happen.
It is not true that a local directory used to have, or even has, precedence over installed packages:
Since a certain version, the default behaviour of editable packages changed and now presents a noticeable difference w.r.t. normally-installed packages, and present difficulties developing certain repositories layout (a monorepo where the directory name matches the package name, for instance - like psycopg 3 repository).
So, this is a regression. My questions are:
is this regression wanted? As in, is the current behaviour the wanted behaviour? If so please document it (but with a WARNING, not with obscure options which need a pass-through pip command to activate, hence don’t even appear in
pip --help
) It would seem exceedingly bizarre to me. I invite you to look at the psycopg readme: we used to suggest to hack on the project using-e
, whereas now we should explain setuptools internals.is this regression unexpected? It sounds so to me, because other modes work differently (non-editable install, strict-editable, compat-editable). If so, is it expected to be fixed and can it become part of the spec/tests?
Thank you
Sorry for that. I never remember it by heart 😕
These are the options, copied straight from the docs:
Hi @qci-amos, please note the following caveat for
SETUPTOOLS_ENABLE_FEATURES
:Pip no longer allows backends to not implement PEP 660. So that is no longer an option.
I think the right question here is to ask how
vscode
andpylance
allow you to pass customised--config-settings
topip
.