python3.pkgs.pythonRelaxDepsHook: don't propagate wheel

The usage of wheel should be restricted to the hook. I discovered this
when trying to remove wheel from the Python bootstrap. Some packages
that needed wheel did not need it added explicitly because they use this
hook. This implicit change to the dependency tree shouldn't happen (even
though it is mostly harmless).
This commit is contained in:
Theodore Ni
2023-08-20 11:00:51 +02:00
committed by Frederik Rietdijk
parent 4e7188c39a
commit dd1256d2ca
2 changed files with 5 additions and 4 deletions
@@ -144,9 +144,8 @@ in {
pythonRelaxDepsHook = callPackage ({ makePythonHook, wheel }:
makePythonHook {
name = "python-relax-deps-hook";
propagatedBuildInputs = [ wheel ];
substitutions = {
inherit pythonInterpreter;
inherit pythonInterpreter pythonSitePackages wheel;
};
} ./python-relax-deps-hook.sh) {};
@@ -84,7 +84,8 @@ pythonRelaxDepsHook() {
# We generally shouldn't have multiple wheel files, but let's be safer here
for wheel in "$pkg_name"*".whl"; do
@pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel"
PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \
@pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel"
rm -rf "$wheel"
# Using no quotes on purpose since we need to expand the glob from `$metadata_file`
@@ -96,7 +97,8 @@ pythonRelaxDepsHook() {
cat $metadata_file
fi
@pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"*
PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \
@pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"*
done
# Remove the folder since it will otherwise be in the dist output.