This is a script to repack the package cache used by pipx tests to minimize space use.
The procedure:
-
Run
nox -e refresh_packages_cacheto create the initial cache. -
Build wheels for all sdists, except for:
shell-functools-*.tar.gz
Basically, unpack
.tar.gz,python -m build -w, move the wheel back into the cache directory. -
Remove all wheels for
pip,setuptoolsandwheel(but be careful not to removesetuptools_scm-*.whl). -
Run the script to create the shim directory, e.g.:
./pipx-repack.wheels /tmp/pipx/.pipx_tests/package_cache /tmp/pipx-1.6.0-test-shim -
Add the remaining sdists (as listed above) and repack them manually (ideally you can just copy the file from the earlier shim version).
-
tar -cf pipx-1.6.0-test-shim.tar pipx-1.6.0-test-shimIt's a good idea to test it now (put it in
DISTDIR, remove.xzfrom ebuild, update version). -
xz -9e pipx-1.6.0-test-shim.tarand voilà!