Merge pull request #104781 from NixOS/staging-next

Staging next
This commit is contained in:
Frederik Rietdijk
2020-11-30 18:27:29 +01:00
committed by GitHub
87 changed files with 856 additions and 449 deletions

View File

@@ -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) {};

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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)