@@ -5,6 +5,7 @@
|
||||
, disabledIf
|
||||
, isPy3k
|
||||
, ensureNewerSourcesForZipFilesHook
|
||||
, findutils
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -94,7 +95,7 @@ in rec {
|
||||
makeSetupHook {
|
||||
name = "python-namespaces-hook.sh";
|
||||
substitutions = {
|
||||
inherit pythonSitePackages;
|
||||
inherit pythonSitePackages findutils;
|
||||
};
|
||||
} ./python-namespaces-hook.sh) {};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ pipInstallPhase() {
|
||||
export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"
|
||||
|
||||
pushd dist || return 1
|
||||
@pythonInterpreter@ -m pip install ./*.whl --no-index --prefix="$out" --no-cache $pipInstallFlags --build tmpbuild
|
||||
@pythonInterpreter@ -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags --build tmpbuild
|
||||
popd || return 1
|
||||
|
||||
runHook postInstall
|
||||
|
||||
@@ -17,16 +17,17 @@ pythonNamespacesHook() {
|
||||
for pathSegment in ${pathSegments[@]}; do
|
||||
constructedPath=${constructedPath}/${pathSegment}
|
||||
pathToRemove=${constructedPath}/__init__.py
|
||||
pycachePath=${constructedPath}/__pycache__/__init__*
|
||||
pycachePath=${constructedPath}/__pycache__/
|
||||
|
||||
# remove __init__.py
|
||||
if [ -f "$pathToRemove" ]; then
|
||||
echo "Removing $pathToRemove"
|
||||
rm "$pathToRemove"
|
||||
rm -v "$pathToRemove"
|
||||
fi
|
||||
|
||||
if [ -f "$pycachePath" ]; then
|
||||
echo "Removing $pycachePath"
|
||||
rm "$pycachePath"
|
||||
# remove __pycache__/ entry, can be interpreter specific. E.g. __init__.cpython-38.pyc
|
||||
# use null characters to perserve potential whitespace in filepath
|
||||
if [ -d "$pycachePath" ]; then
|
||||
@findutils@/bin/find "$pycachePath" -name '__init__*' -exec rm -v "{}" +
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -53,7 +53,9 @@
|
||||
, disabled ? false
|
||||
|
||||
# Raise an error if two packages are installed with the same name
|
||||
, catchConflicts ? true
|
||||
# TODO: For cross we probably need a different PYTHONPATH, or not
|
||||
# add the runtime deps until after buildPhase.
|
||||
, catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform)
|
||||
|
||||
# Additional arguments to pass to the makeWrapper function, which wraps
|
||||
# generated binaries.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ python
|
||||
{ stdenv
|
||||
, python
|
||||
, runCommand
|
||||
, substituteAll
|
||||
, lib
|
||||
@@ -92,4 +93,4 @@ let
|
||||
|
||||
|
||||
|
||||
in environmentTests // integrationTests
|
||||
in stdenv.lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests)
|
||||
|
||||
Reference in New Issue
Block a user