Loading pkgs/development/interpreters/python/catch_conflicts/catch_conflicts_py2.py 0 → 100644 +30 −0 Original line number Diff line number Diff line import pkg_resources import collections import sys do_abort = False packages = collections.defaultdict(list) for f in sys.path: for req in pkg_resources.find_distributions(f): if req not in packages[req.project_name]: # some exceptions inside buildPythonPackage if req.project_name in ['setuptools', 'pip', 'wheel']: continue packages[req.project_name].append(req) for name, duplicates in packages.items(): if len(duplicates) > 1: do_abort = True print("Found duplicated packages in closure for dependency '{}': ".format(name)) for dup in duplicates: print(" " + repr(dup)) if do_abort: print("") print( 'Package duplicates found in closure, see above. Usually this ' 'happens if two packages depend on different version ' 'of the same dependency.') sys.exit(1) pkgs/development/interpreters/python/hooks/default.nix +9 −2 Original line number Diff line number Diff line Loading @@ -106,9 +106,16 @@ in { pythonCatchConflictsHook = callPackage ({ makePythonHook, setuptools }: makePythonHook { name = "python-catch-conflicts-hook"; substitutions = { substitutions = let useLegacyHook = lib.versionOlder python.version "3.10"; in { inherit pythonInterpreter pythonSitePackages; catchConflicts=../catch_conflicts/catch_conflicts.py; catchConflicts = if useLegacyHook then ../catch_conflicts/catch_conflicts_py2.py else ../catch_conflicts/catch_conflicts.py; } // lib.optionalAttrs useLegacyHook { inherit setuptools; }; } ./python-catch-conflicts-hook.sh) {}; Loading pkgs/development/interpreters/python/python2/mk-python-derivation.nix +1 −2 Original line number Diff line number Diff line Loading @@ -57,8 +57,7 @@ # Raise an error if two packages are installed with the same name # TODO: For cross we probably need a different PYTHONPATH, or not # add the runtime deps until after buildPhase. # FIXME: disabled for Python 2 because broken , catchConflicts ? false , catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform) # Additional arguments to pass to the makeWrapper function, which wraps # generated binaries. Loading Loading
pkgs/development/interpreters/python/catch_conflicts/catch_conflicts_py2.py 0 → 100644 +30 −0 Original line number Diff line number Diff line import pkg_resources import collections import sys do_abort = False packages = collections.defaultdict(list) for f in sys.path: for req in pkg_resources.find_distributions(f): if req not in packages[req.project_name]: # some exceptions inside buildPythonPackage if req.project_name in ['setuptools', 'pip', 'wheel']: continue packages[req.project_name].append(req) for name, duplicates in packages.items(): if len(duplicates) > 1: do_abort = True print("Found duplicated packages in closure for dependency '{}': ".format(name)) for dup in duplicates: print(" " + repr(dup)) if do_abort: print("") print( 'Package duplicates found in closure, see above. Usually this ' 'happens if two packages depend on different version ' 'of the same dependency.') sys.exit(1)
pkgs/development/interpreters/python/hooks/default.nix +9 −2 Original line number Diff line number Diff line Loading @@ -106,9 +106,16 @@ in { pythonCatchConflictsHook = callPackage ({ makePythonHook, setuptools }: makePythonHook { name = "python-catch-conflicts-hook"; substitutions = { substitutions = let useLegacyHook = lib.versionOlder python.version "3.10"; in { inherit pythonInterpreter pythonSitePackages; catchConflicts=../catch_conflicts/catch_conflicts.py; catchConflicts = if useLegacyHook then ../catch_conflicts/catch_conflicts_py2.py else ../catch_conflicts/catch_conflicts.py; } // lib.optionalAttrs useLegacyHook { inherit setuptools; }; } ./python-catch-conflicts-hook.sh) {}; Loading
pkgs/development/interpreters/python/python2/mk-python-derivation.nix +1 −2 Original line number Diff line number Diff line Loading @@ -57,8 +57,7 @@ # Raise an error if two packages are installed with the same name # TODO: For cross we probably need a different PYTHONPATH, or not # add the runtime deps until after buildPhase. # FIXME: disabled for Python 2 because broken , catchConflicts ? false , catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform) # Additional arguments to pass to the makeWrapper function, which wraps # generated binaries. Loading