Commit 359768b
committed
Makefile: stop leaking legacy-editable into third party builds
The .venv target exported SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
across the whole "pipenv sync", where it leaked into pip's PEP 517
isolated build environments. setuptools always lists the PEP 660 hooks
in build_meta.__all__ but only defines them when that feature is off, so
any third party sdist whose backend does "from setuptools.build_meta
import *" dies with
AttributeError: module 'setuptools.build_meta' has no attribute
'get_requires_for_build_editable'
This only bites when pip actually has to build from source, which made it
look distro specific: pillow 12.3.0 dropped the manylinux2014 wheels, so
sles-12sp5 (glibc 2.22) is the only distro in the matrix below the
manylinux_2_28 floor and the only one that builds it from an sdist.
Run the sync without the variable and give our own packages their
mypy-friendly layout afterwards instead. editable_mode=compat is
setuptools' supported replacement for the feature flag: it writes the
same plain path .pth that mypy needs (mypy still cannot follow the PEP
660 import hook, see python/mypy#13392), but goes through the regular
build_editable hook. So it neither leaks into anybody else's build nor
depends on pip's "setup.py develop" fallback, which pip >= 26 removed -
keeping legacy-editable here would have worked on CI, whose venv seeds
pip 23.3.1, while failing on newer developer setups with
ERROR: Project ... uses a build backend that is missing the
'build_editable' hook
Change-Id: If140d7875134e5a0c9ac2f62324607ab26ee77531 parent 32a84dc commit 359768b
1 file changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
433 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
434 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
435 | 449 | | |
436 | 450 | | |
437 | 451 | | |
| |||
441 | 455 | | |
442 | 456 | | |
443 | 457 | | |
444 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
445 | 463 | | |
0 commit comments