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:developand:customreinstalls: (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:developfor projects that only usepyproject.toml. -
Make
zc.recipe.egg:developreinstall if .egg-info / .dist-info in package folder is removed:zc.recipe.egg:developnot only creates apackage-name.egg-linkin./develop-eggs, it also generates a.egg-infoor a.dist-infodirectly in the package folder referenced by the.egg-link. That's what letssetuptoolsdetect that the egg is already installed, so removing it breaks the develop install. -
Enable
zc.recipe.egg:customwith projects that only usepyproject.toml: Letzc.buildout.easy_install.builddiscoverpyproject.tomlin source tree in addition tosetup.py. -
Fix
setuptools.package_indexusage after PEP 625: An egg calleddot.separated.namewill now yield a source distributiondot_separated_name-xxx.tar.gz, which when uploaded on PyPI or another index may result insetuptools.package_indexfinding a distribution fordot-separate-name(after normalization ofdot_separated_nameto a canonical form), leading buildout to fail to find a distribution fordot.separated.name. -
Fix
.pydistutils.cfgfile and containing temporary$HOMEfolder leaking after buildout run: the temporary$HOMEfolder was created at module level and cleaned withatexit, but (1)slapos.rebootstrapcallsos.execve, leading to resources from the original process never being cleaned up and (2) some promises may importzc.buildout.easy_install, triggering temporary$HOMEand.pydistutils.cfgcreation, and be killed without opportunity of cleanup if they timeout. So instead temporary$HOMEand.pydistutils.cfgare created at eachpipinvocation.