zc.buildout 3.0.1+slapos003: Fix newly discovered bugs
These are fixes for issues that were discovered after !30 (merged) and during !31 (merged). They are included in a separate MR from !31 (merged) because they diverge from the original aim of !31 (merged) and in order not to hold up !31 (merged).
Like in !31 (merged), it seems judicious to rewrite history since 3.0.1
to immediately apply fixups and reorder commits in a way that presents our patches over 3.0.1
cohesively, instead of leaving this as work for later rebases or merging upstream, that will accumulate and makes such rebases harder. This rewrite has already been done in parallel branch rebase/fix-develop-build-artifacts, which has the exact same working tree but a rewritten history since 3.0.1
.
-
Fix
zc.recipe.egg:develop
and:custom
reinstalls: (1) Make the egg be properly reinstalled when versions of setup-eggs change and (2) make later runs of develop actually reinstall by switching topip install --editable
. This also enableszc.recipe.egg:develop
for projects that only usepyproject.toml
. -
Make
zc.recipe.egg:develop
reinstall if .egg-info / .dist-info in package folder is removed:zc.recipe.egg:develop
not only creates apackage-name.egg-link
in./develop-eggs
, it also generates a.egg-info
or a.dist-info
directly in the package folder referenced by the.egg-link
. That's what letssetuptools
detect that the egg is already installed, so removing it breaks the develop install. -
Enable
zc.recipe.egg:custom
with projects that only usepyproject.toml
: Letzc.buildout.easy_install.build
discoverpyproject.toml
in source tree in addition tosetup.py
. -
Fix
setuptools.package_index
usage after PEP 625: An egg calleddot.separated.name
will now yield a source distributiondot_separated_name-xxx.tar.gz
, which when uploaded on PyPI or another index may result insetuptools.package_index
finding a distribution fordot-separate-name
(after normalization ofdot_separated_name
to a canonical form), leading buildout to fail to find a distribution fordot.separated.name
. -
Fix
.pydistutils.cfg
file and containing temporary$HOME
folder leaking after buildout run: the temporary$HOME
folder was created at module level and cleaned withatexit
, but (1)slapos.rebootstrap
callsos.execve
, leading to resources from the original process never being cleaned up and (2) some promises may importzc.buildout.easy_install
, triggering temporary$HOME
and.pydistutils.cfg
creation, and be killed without opportunity of cleanup if they timeout. So instead temporary$HOME
and.pydistutils.cfg
are created at eachpip
invocation.