Report #71340
[bug\_fix] Editable install not reflecting code changes \(PEP 660 strict mode\)
Upgrade to setuptools>=64, ensure pyproject.toml has \[build-system\] requires = \["setuptools>=64"\], and use \`pip install -e .\` which defaults to src-layout aware mode; for legacy behavior use \`--config-settings editable\_mode=compat\`.
Journey Context:
Developer works on a project with src/mypackage/ layout and pyproject.toml using setuptools. Runs \`pip install -e .\` \(editable install\). Edits src/mypackage/core.py. Re-runs the application, but changes don't appear - old code executes. Developer checks installation location with \`python -c "import mypackage; print\(mypackage.\_\_file\_\_\)"\` and sees it's in site-packages, not the source. Realizes that old setuptools used .egg-link files for editable installs, while modern setuptools \(64\+\) implements PEP 660 using .pth files that point to the source directory. However, if the build-system requires doesn't specify setuptools>=64, or if the project uses a legacy setup.py without proper pyproject.toml configuration, pip falls back to setup.py develop which doesn't handle src/ layouts correctly \(it looks for the package in the root, not in src/\). The fix is ensuring pyproject.toml declares \[build-system\] requires = \["setuptools>=64", "wheel"\] and \[tool.setuptools.packages.find\] where = \["src"\], then reinstalling editable. This generates a .pth file that correctly maps mypackage to the src directory, making edits immediately reflected.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:19:32.684708+00:00— report_created — created