From 46ea770b2b1e105cab806cdd3845b2ec02ea66e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 1 Apr 2017 12:20:31 +0200 Subject: [PATCH] Revert "python: Move catch_conflicts.py into subdirectory (#23600)" (#24528) This reverts commit 76213d102c1eaa91e733b326d9d312b60103d88a. --- .../python/{catch_conflicts => }/catch_conflicts.py | 0 .../interpreters/python/catch_conflicts/README.md | 13 ------------- .../interpreters/python/mk-python-derivation.nix | 9 +++++---- 3 files changed, 5 insertions(+), 17 deletions(-) rename pkgs/development/interpreters/python/{catch_conflicts => }/catch_conflicts.py (100%) delete mode 100644 pkgs/development/interpreters/python/catch_conflicts/README.md diff --git a/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py b/pkgs/development/interpreters/python/catch_conflicts.py similarity index 100% rename from pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py rename to pkgs/development/interpreters/python/catch_conflicts.py diff --git a/pkgs/development/interpreters/python/catch_conflicts/README.md b/pkgs/development/interpreters/python/catch_conflicts/README.md deleted file mode 100644 index d144b80e338..00000000000 --- a/pkgs/development/interpreters/python/catch_conflicts/README.md +++ /dev/null @@ -1,13 +0,0 @@ - - -catch_conflicts.py -================== - -The file catch_conflicts.py is in a subdirectory because, if it isn't, the -/nix/store/ directory is added to sys.path causing a delay when building. - -Pointers: - -- https://docs.python.org/3/library/sys.html#sys.path - -- https://github.com/NixOS/nixpkgs/pull/23600 diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 5d710fcad88..f30bd175daa 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -79,10 +79,9 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { postFixup = '' wrapPythonPrograms '' + lib.optionalString catchConflicts '' - # Check if we have two packages with the same name in the closure and fail. - # If this happens, something went wrong with the dependencies specs. - # Intentionally kept in a subdirectory, see catch_conflicts/README.md. - ${python.interpreter} ${./catch_conflicts}/catch_conflicts.py + # check if we have two packages with the same name in closure and fail + # this shouldn't happen, something went wrong with dependencies specs + ${python.interpreter} ${./catch_conflicts.py} '' + attrs.postFixup or ''''; passthru = { @@ -99,3 +98,5 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { isBuildPythonPackage = python.meta.platforms; }; }) + +