diff options
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/python')
9 files changed, 473 insertions, 88 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch b/nixpkgs/pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch new file mode 100644 index 000000000000..ca6a76d0ffd9 --- /dev/null +++ b/nixpkgs/pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch @@ -0,0 +1,107 @@ +From 5330b6af9f832af59aa5c61d9ef6971053a8e709 Mon Sep 17 00:00:00 2001 +From: Jonathan Ringer <jonringer117@gmail.com> +Date: Mon, 9 Nov 2020 10:24:35 -0800 +Subject: [PATCH] CPython: Don't use ldconfig + +--- + Lib/ctypes/util.py | 77 ++-------------------------------------------- + 1 file changed, 2 insertions(+), 75 deletions(-) + +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 0c2510e161..7fb98af308 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -100,53 +100,7 @@ def _is_elf(filename): + return thefile.read(4) == elf_header + + def _findLib_gcc(name): +- # Run GCC's linker with the -t (aka --trace) option and examine the +- # library name it prints out. The GCC command will fail because we +- # haven't supplied a proper program with main(), but that does not +- # matter. +- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) +- +- c_compiler = shutil.which('gcc') +- if not c_compiler: +- c_compiler = shutil.which('cc') +- if not c_compiler: +- # No C compiler available, give up +- return None +- +- temp = tempfile.NamedTemporaryFile() +- try: +- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] +- +- env = dict(os.environ) +- env['LC_ALL'] = 'C' +- env['LANG'] = 'C' +- try: +- proc = subprocess.Popen(args, +- stdout=subprocess.PIPE, +- stderr=subprocess.STDOUT, +- env=env) +- except OSError: # E.g. bad executable +- return None +- with proc: +- trace = proc.stdout.read() +- finally: +- try: +- temp.close() +- except FileNotFoundError: +- # Raised if the file was already removed, which is the normal +- # behaviour of GCC if linking fails +- pass +- res = re.findall(expr, trace) +- if not res: +- return None +- +- for file in res: +- # Check if the given file is an elf file: gcc can report +- # some files that are linker scripts and not actual +- # shared objects. See bpo-41976 for more details +- if not _is_elf(file): +- continue +- return os.fsdecode(file) ++ return None + + + if sys.platform == "sunos5": +@@ -268,34 +222,7 @@ def find_library(name, is64 = False): + else: + + def _findSoname_ldconfig(name): +- import struct +- if struct.calcsize('l') == 4: +- machine = os.uname().machine + '-32' +- else: +- machine = os.uname().machine + '-64' +- mach_map = { +- 'x86_64-64': 'libc6,x86-64', +- 'ppc64-64': 'libc6,64bit', +- 'sparc64-64': 'libc6,64bit', +- 's390x-64': 'libc6,64bit', +- 'ia64-64': 'libc6,IA-64', +- } +- abi_type = mach_map.get(machine, 'libc6') +- +- # XXX assuming GLIBC's ldconfig (with option -p) +- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' +- regex = os.fsencode(regex % (re.escape(name), abi_type)) +- try: +- with subprocess.Popen(['/sbin/ldconfig', '-p'], +- stdin=subprocess.DEVNULL, +- stderr=subprocess.DEVNULL, +- stdout=subprocess.PIPE, +- env={'LC_ALL': 'C', 'LANG': 'C'}) as p: +- res = re.search(regex, p.stdout.read()) +- if res: +- return os.fsdecode(res.group(1)) +- except OSError: +- pass ++ return None + + def _findLib_ld(name): + # See issue #9998 for why this is needed +-- +2.33.1 + diff --git a/nixpkgs/pkgs/development/interpreters/python/cpython/default.nix b/nixpkgs/pkgs/development/interpreters/python/cpython/default.nix index 6778dc460e05..eac1ba98beed 100644 --- a/nixpkgs/pkgs/development/interpreters/python/cpython/default.nix +++ b/nixpkgs/pkgs/development/interpreters/python/cpython/default.nix @@ -58,6 +58,7 @@ , reproducibleBuild ? false , pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}" , noldconfigPatch ? ./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch" +, testers } @ inputs: # Note: this package is used for bootstrapping fetchurl, and thus @@ -195,25 +196,22 @@ let if parsed.cpu.significantByte.name == "littleEndian" then "arm" else "armeb" else if isx86_32 then "i386" else parsed.cpu.name; - # Python doesn't distinguish musl and glibc and always prefixes with "gnu" - gnuAbiName = replaceStrings [ "musl" ] [ "gnu" ] parsed.abi.name; - pythonAbiName = - # python's build doesn't support every gnu<extension>, and doesn't - # differentiate between musl and glibc, so we list those supported in - # here: + + pythonAbiName = let + # python's build doesn't match the nixpkgs abi in some cases. # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L724 - # Note: this is an approximation, as it doesn't take into account the CPU - # family, or the nixpkgs abi naming conventions. - if elem gnuAbiName [ - "gnux32" - "gnueabihf" - "gnueabi" - "gnuabin32" - "gnuabi64" - "gnuspe" - ] - then gnuAbiName - else "gnu"; + nixpkgsPythonAbiMappings = { + "gnuabielfv2" = "gnu"; + "muslabielfv2" = "musl"; + }; + pythonAbi = nixpkgsPythonAbiMappings.${parsed.abi.name} or parsed.abi.name; + in + # Python <3.11 doesn't distinguish musl and glibc and always prefixes with "gnu" + if lib.versionOlder version "3.11" then + replaceStrings [ "musl" ] [ "gnu" ] pythonAbi + else + pythonAbi; + multiarch = if isDarwin then "darwin" else if isWindows then "" @@ -235,7 +233,7 @@ let ''; execSuffix = stdenv.hostPlatform.extensions.executable; -in with passthru; stdenv.mkDerivation { +in with passthru; stdenv.mkDerivation (finalAttrs: { pname = "python3"; inherit src version; @@ -305,9 +303,12 @@ in with passthru; stdenv.mkDerivation { ./3.8/0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch # Use sysconfigdata to find headers. Fixes cross-compilation of extension modules. ./3.7/fix-finding-headers-when-cross-compiling.patch - ] ++ optionals stdenv.hostPlatform.isLoongArch64 [ + ] ++ optionals (pythonOlder "3.12") [ # https://github.com/python/cpython/issues/90656 ./loongarch-support.patch + ] ++ optionals (pythonAtLeast "3.11" && pythonOlder "3.13") [ + # backport fix for https://github.com/python/cpython/issues/95855 + ./platform-triplet-detection.patch ] ++ optionals (stdenv.hostPlatform.isMinGW) (let # https://src.fedoraproject.org/rpms/mingw-python3 mingw-patch = fetchgit { @@ -326,7 +327,7 @@ in with passthru; stdenv.mkDerivation { '' + optionalString mimetypesSupport '' substituteInPlace Lib/mimetypes.py \ --replace "@mime-types@" "${mailcap}" - '' + optionalString (x11Support && (tix != null)) '' + '' + optionalString (pythonOlder "3.13" && x11Support && (tix != null)) '' substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" ''; @@ -582,6 +583,8 @@ in with passthru; stdenv.mkDerivation { nativeBuildInputs = with pkgsBuildBuild.python3.pkgs; [ sphinxHook python_docs_theme ]; }; + + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; }; enableParallelBuilding = true; @@ -607,8 +610,9 @@ in with passthru; stdenv.mkDerivation { high level dynamic data types. ''; license = licenses.psfl; + pkgConfigModules = [ "python3" ]; platforms = platforms.linux ++ platforms.darwin ++ platforms.windows; maintainers = with maintainers; [ fridh ]; mainProgram = executable; }; -} +}) diff --git a/nixpkgs/pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch b/nixpkgs/pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch new file mode 100644 index 000000000000..ec76546f54ee --- /dev/null +++ b/nixpkgs/pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch @@ -0,0 +1,295 @@ +diff --git a/configure.ac b/configure.ac +index ba768aea93..621ac166bd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -936,125 +936,192 @@ cat > conftest.c <<EOF + #if defined(__ANDROID__) + # Android is not a multiarch system. + #elif defined(__linux__) ++# include <features.h> ++# if defined(__UCLIBC__) ++# error uclibc not supported ++# elif defined(__dietlibc__) ++# error dietlibc not supported ++# elif defined(__GLIBC__) ++# define LIBC gnu ++# define LIBC_X32 gnux32 ++# if defined(__ARM_PCS_VFP) ++# define LIBC_ARM gnueabihf ++# else ++# define LIBC_ARM gnueabi ++# endif ++# if defined(__loongarch__) ++# if defined(__loongarch_soft_float) ++# define LIBC_LA gnusf ++# elif defined(__loongarch_single_float) ++# define LIBC_LA gnuf32 ++# elif defined(__loongarch_double_float) ++# define LIBC_LA gnu ++# else ++# error unknown loongarch floating-point base abi ++# endif ++# endif ++# if defined(_MIPS_SIM) ++# if defined(__mips_hard_float) ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS gnu ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS gnuabin32 ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS gnuabi64 ++# else ++# error unknown mips sim value ++# endif ++# else ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS gnusf ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS gnuabin32sf ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS gnuabi64sf ++# else ++# error unknown mips sim value ++# endif ++# endif ++# endif ++# if defined(__SPE__) ++# define LIBC_PPC gnuspe ++# else ++# define LIBC_PPC gnu ++# endif ++# else ++# include <stdarg.h> ++# ifdef __DEFINED_va_list ++# define LIBC musl ++# define LIBC_X32 muslx32 ++# if defined(__ARM_PCS_VFP) ++# define LIBC_ARM musleabihf ++# else ++# define LIBC_ARM musleabi ++# endif ++# if defined(__loongarch__) ++# if defined(__loongarch_soft_float) ++# define LIBC_LA muslsf ++# elif defined(__loongarch_single_float) ++# define LIBC_LA muslf32 ++# elif defined(__loongarch_double_float) ++# define LIBC_LA musl ++# else ++# error unknown loongarch floating-point base abi ++# endif ++# endif ++# if defined(_MIPS_SIM) ++# if defined(__mips_hard_float) ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS musl ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS musln32 ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS musl ++# else ++# error unknown mips sim value ++# endif ++# else ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS muslsf ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS musln32sf ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS muslsf ++# else ++# error unknown mips sim value ++# endif ++# endif ++# endif ++# if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) ++# define LIBC_PPC muslsf ++# else ++# define LIBC_PPC musl ++# endif ++# else ++# error unknown libc ++# endif ++# endif + # if defined(__x86_64__) && defined(__LP64__) +- x86_64-linux-gnu ++ x86_64-linux-LIBC + # elif defined(__x86_64__) && defined(__ILP32__) +- x86_64-linux-gnux32 ++ x86_64-linux-LIBC_X32 + # elif defined(__i386__) +- i386-linux-gnu ++ i386-linux-LIBC + # elif defined(__aarch64__) && defined(__AARCH64EL__) + # if defined(__ILP32__) +- aarch64_ilp32-linux-gnu ++ aarch64_ilp32-linux-LIBC + # else +- aarch64-linux-gnu ++ aarch64-linux-LIBC + # endif + # elif defined(__aarch64__) && defined(__AARCH64EB__) + # if defined(__ILP32__) +- aarch64_be_ilp32-linux-gnu ++ aarch64_be_ilp32-linux-LIBC + # else +- aarch64_be-linux-gnu ++ aarch64_be-linux-LIBC + # endif + # elif defined(__alpha__) +- alpha-linux-gnu +-# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP) ++ alpha-linux-LIBC ++# elif defined(__ARM_EABI__) + # if defined(__ARMEL__) +- arm-linux-gnueabihf ++ arm-linux-LIBC_ARM + # else +- armeb-linux-gnueabihf +-# endif +-# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP) +-# if defined(__ARMEL__) +- arm-linux-gnueabi +-# else +- armeb-linux-gnueabi ++ armeb-linux-LIBC_ARM + # endif + # elif defined(__hppa__) +- hppa-linux-gnu ++ hppa-linux-LIBC + # elif defined(__ia64__) +- ia64-linux-gnu +-# elif defined(__loongarch__) +-# if defined(__loongarch_lp64) +-# if defined(__loongarch_soft_float) +- loongarch64-linux-gnusf +-# elif defined(__loongarch_single_float) +- loongarch64-linux-gnuf32 +-# elif defined(__loongarch_double_float) +- loongarch64-linux-gnu ++ ia64-linux-LIBC ++# elif defined(__loongarch__) && defined(__loongarch_lp64) ++ loongarch64-linux-LIBC_LA ++# elif defined(__m68k__) && !defined(__mcoldfire__) ++ m68k-linux-LIBC ++# elif defined(__mips__) ++# if defined(__mips_isa_rev) && (__mips_isa_rev >=6) ++# if defined(_MIPSEL) && defined(__mips64) ++ mipsisa64r6el-linux-LIBC_MIPS ++# elif defined(_MIPSEL) ++ mipsisa32r6el-linux-LIBC_MIPS ++# elif defined(__mips64) ++ mipsisa64r6-linux-LIBC_MIPS + # else +-# error unknown platform triplet ++ mipsisa32r6-linux-LIBC_MIPS + # endif + # else +-# error unknown platform triplet +-# endif +-# elif defined(__m68k__) && !defined(__mcoldfire__) +- m68k-linux-gnu +-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6el-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsel-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) +-# if _MIPS_SIM == _ABIO32 +- mips-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64-linux-gnuabi64 +-# else +-# error unknown platform triplet ++# if defined(_MIPSEL) && defined(__mips64) ++ mips64el-linux-LIBC_MIPS ++# elif defined(_MIPSEL) ++ mipsel-linux-LIBC_MIPS ++# elif defined(__mips64) ++ mips64-linux-LIBC_MIPS ++# else ++ mips-linux-LIBC_MIPS ++# endif + # endif + # elif defined(__or1k__) +- or1k-linux-gnu +-# elif defined(__powerpc__) && defined(__SPE__) +- powerpc-linux-gnuspe ++ or1k-linux-LIBC + # elif defined(__powerpc64__) + # if defined(__LITTLE_ENDIAN__) +- powerpc64le-linux-gnu ++ powerpc64le-linux-LIBC + # else +- powerpc64-linux-gnu ++ powerpc64-linux-LIBC + # endif + # elif defined(__powerpc__) +- powerpc-linux-gnu ++ powerpc-linux-LIBC_PPC + # elif defined(__s390x__) +- s390x-linux-gnu ++ s390x-linux-LIBC + # elif defined(__s390__) +- s390-linux-gnu ++ s390-linux-LIBC + # elif defined(__sh__) && defined(__LITTLE_ENDIAN__) +- sh4-linux-gnu ++ sh4-linux-LIBC + # elif defined(__sparc__) && defined(__arch64__) +- sparc64-linux-gnu ++ sparc64-linux-LIBC + # elif defined(__sparc__) +- sparc-linux-gnu ++ sparc-linux-LIBC + # elif defined(__riscv) + # if __riscv_xlen == 32 +- riscv32-linux-gnu ++ riscv32-linux-LIBC + # elif __riscv_xlen == 64 +- riscv64-linux-gnu ++ riscv64-linux-LIBC + # else + # error unknown platform triplet + # endif +@@ -1102,12 +1169,7 @@ cat > conftest.c <<EOF + EOF + + if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then +- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` +- case "$build_os" in +- linux-musl*) +- PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` +- ;; +- esac ++ PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | grep -v typedef | tr -d ' '` + AC_MSG_RESULT([$PLATFORM_TRIPLET]) + else + AC_MSG_RESULT([none]) diff --git a/nixpkgs/pkgs/development/interpreters/python/default.nix b/nixpkgs/pkgs/development/interpreters/python/default.nix index 902015ecfb62..2d293bb29a0e 100644 --- a/nixpkgs/pkgs/development/interpreters/python/default.nix +++ b/nixpkgs/pkgs/development/interpreters/python/default.nix @@ -20,20 +20,20 @@ sourceVersion = { major = "3"; minor = "10"; - patch = "12"; + patch = "13"; suffix = ""; }; - hash = "sha256-r7dL8ZEw56R9EDEsj154TyTgUnmB6raOIFRs+4ZYMLg="; + hash = "sha256-XIiEhmhkDT4VKzW0U27xwjsspL0slX7x7LsFP1cd0/Y="; }; python311 = { sourceVersion = { major = "3"; minor = "11"; - patch = "4"; + patch = "5"; suffix = ""; }; - hash = "sha256-Lw5AnfKrV6qfxMvd+5dq9E5OVb9vYZ7ua8XCKXJkp/Y="; + hash = "sha256-hc0S6c8dbVpF8X96/hzr5+5ijTKCKBxJLoat9jbe+j8="; }; }; @@ -96,13 +96,25 @@ in { major = "3"; minor = "12"; patch = "0"; - suffix = "rc3"; + suffix = ""; }; - hash = "sha256-ljl+iR6YgCsdOZ3uPOrrm88KolZsinsczk0BlsJ3UGo="; + hash = "sha256-eVw09E30Wg6blxDIxxwVxnGHFSTNQSyhTe8hLozLFV0="; inherit (darwin) configd; inherit passthruFun; }; + python313 = callPackage ./cpython { + self = __splicedPackages.python313; + sourceVersion = { + major = "3"; + minor = "13"; + patch = "0"; + suffix = "a1"; + }; + hash = "sha256-8Cgb8izABBQ2HBT8kZcYPn6y6rtylla2lEIiT7tj7ss="; + inherit (darwin) configd; + inherit passthruFun; + }; # Minimal versions of Python (built without optional dependencies) python3Minimal = (callPackage ./cpython ({ self = __splicedPackages.python3Minimal; @@ -127,7 +139,7 @@ in { enableOptimizations = false; enableLTO = false; mimetypesSupport = false; - } // sources.python310)).overrideAttrs(old: { + } // sources.python311)).overrideAttrs(old: { # TODO(@Artturin): Add this to the main cpython expr strictDeps = true; pname = "python3-minimal"; @@ -138,10 +150,10 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "11"; + patch = "12"; }; - hash = "sha256-ERevtmgx2k6m852NIIR4enRon9AineC+MB+e2bJVCTw="; + hash = "sha256-3WHYjaJ0ws4s7HdmfUo9+aZSvMUOJvkJkdTdCvZrzPQ="; pythonVersion = "2.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = __splicedPackages.pythonInterpreters.pypy27_prebuilt; @@ -155,10 +167,10 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "11"; + patch = "12"; }; - hash = "sha256-sPMWb7Klqt/VzrnbXN1feSmg7MygK0omwNrgSS98qOo="; + hash = "sha256-56IEbH5sJfw4aru1Ey6Sp8wkkeOTVpmpRstdy7NCwqo="; pythonVersion = "3.9"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = __splicedPackages.pypy27; @@ -167,28 +179,26 @@ in { inherit (darwin.apple_sdk.frameworks) Security; }; - pypy38 = __splicedPackages.pypy39.override { - self = __splicedPackages.pythonInterpreters.pypy38; - pythonVersion = "3.8"; - hash = "sha256-TWdpv8pzc06GZv1wUDt86wam4lkRDmFzMbs4mcpOYFg="; + pypy310 = __splicedPackages.pypy39.override { + self = __splicedPackages.pythonInterpreters.pypy310; + pythonVersion = "3.10"; + hash = "sha256-huTk6sw2BGxhgvQwGHllN/4zpg4dKizGuOf5Gl3LPkI="; }; - pypy37 = throw "pypy37 has been removed from nixpkgs since it is no longer supported upstream"; # Added 2023-01-04 - pypy27_prebuilt = callPackage ./pypy/prebuilt_2_7.nix { # Not included at top-level self = __splicedPackages.pythonInterpreters.pypy27_prebuilt; sourceVersion = { major = "7"; minor = "3"; - patch = "11"; + patch = "12"; }; hash = { - aarch64-linux = "sha256-6pJNod7+kyXvdg4oiwT5hGFOQFWA9TIetqXI9Tm9QVo="; - x86_64-linux = "sha256-uo7ZWKkFwHNaTP/yh1wlCJlU3AIOCH2YKw/6W52jFs0="; - aarch64-darwin = "sha256-zFaWq0+TzTSBweSZC13t17pgrAYC+hiQ02iImmxb93E="; - x86_64-darwin = "sha256-Vt7unCJkD1aGw1udZP2xzjq9BEWD5AePCxccov0qGY4="; + aarch64-linux = "sha256-4E3LYoantHJOw/DlDTzBuoWDMB3RZYwG1/N1meQgHFk="; + x86_64-linux = "sha256-GmGiV0t5Rm9gYBDymZormVvZbNCF+Rp46909XCxA6B0="; + aarch64-darwin = "sha256-a3R6oHauhZfklgPF3sTKWTWhoKEy10BKVZvpaiYNm/c="; + x86_64-darwin = "sha256-bon/3RVTfOT/zjFFtl7lfC6clSiSvZW5NAEtLwCfUDs="; }.${stdenv.system}; pythonVersion = "2.7"; inherit passthruFun; @@ -200,13 +210,13 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "11"; + patch = "12"; }; hash = { - aarch64-linux = "sha256-CRddxlLtiV2Y6a1j0haBK/PufjmNkAqb+espBrqDArk="; - x86_64-linux = "sha256-1QYXLKEQcSdBdddOnFgcMWZDLQF5sDZHDjuejSDq5YE="; - aarch64-darwin = "sha256-ka11APGjlTHb76CzRaPc/5J/+ZcWVOjS6e98WuMR9X4="; - x86_64-darwin = "sha256-0z9AsgcJmHJYWv1xhzV1ym6mOKJ9gjvGISOMWuglQu0="; + aarch64-linux = "sha256-6TJ/ue2vKtkZNdW4Vj7F/yQZO92xdcGsqvdywCWvGCQ="; + x86_64-linux = "sha256-hMiblm+rK1j0UaSC7jDKf+wzUENb0LlhRhXGHcbaI5A="; + aarch64-darwin = "sha256-DooaNGi5eQxzSsaY9bAMwD/BaJnMxs6HZGX6wLg5gOM="; + x86_64-darwin = "sha256-ZPAI/6BwxAfl70bIJWsuAU3nGW6l2Fg4WGElTnlZ9Os="; }.${stdenv.system}; pythonVersion = "3.9"; inherit passthruFun; diff --git a/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix b/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix index 5deb3cf97b8e..ba51c43822d4 100644 --- a/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix +++ b/nixpkgs/pkgs/development/interpreters/python/hooks/default.nix @@ -45,15 +45,6 @@ in { propagatedBuildInputs = [ ]; } ./egg-unpack-hook.sh) {}; - flitBuildHook = callPackage ({ makePythonHook, flit }: - makePythonHook { - name = "flit-build-hook"; - propagatedBuildInputs = [ flit ]; - substitutions = { - inherit pythonInterpreter; - }; - } ./flit-build-hook.sh) {}; - pipBuildHook = callPackage ({ makePythonHook, pip, wheel }: makePythonHook { name = "pip-build-hook.sh"; diff --git a/nixpkgs/pkgs/development/interpreters/python/hooks/flit-build-hook.sh b/nixpkgs/pkgs/development/interpreters/python/hooks/flit-build-hook.sh deleted file mode 100644 index 45893aae00f4..000000000000 --- a/nixpkgs/pkgs/development/interpreters/python/hooks/flit-build-hook.sh +++ /dev/null @@ -1,15 +0,0 @@ -# Setup hook for flit -echo "Sourcing flit-build-hook" - -flitBuildPhase () { - echo "Executing flitBuildPhase" - runHook preBuild - @pythonInterpreter@ -m flit build --format wheel - runHook postBuild - echo "Finished executing flitBuildPhase" -} - -if [ -z "${dontUseFlitBuild-}" ] && [ -z "${buildPhase-}" ]; then - echo "Using flitBuildPhase" - buildPhase=flitBuildPhase -fi diff --git a/nixpkgs/pkgs/development/interpreters/python/mk-python-derivation.nix b/nixpkgs/pkgs/development/interpreters/python/mk-python-derivation.nix index e9c783116b60..fbacf6bb2337 100644 --- a/nixpkgs/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/nixpkgs/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -11,7 +11,6 @@ , namePrefix , update-python-libraries , setuptools -, flitBuildHook , pypaBuildHook , pypaInstallHook , pythonCatchConflictsHook @@ -90,7 +89,6 @@ # Several package formats are supported. # "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. # "wheel" : Install from a pre-compiled wheel. -# "flit" : Install a flit package. This builds a wheel. # "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel. # "egg": Install a package from an egg. # "other" : Provide your own buildPhase and installPhase. @@ -122,7 +120,7 @@ let else "setuptools"; - withDistOutput = lib.elem format' ["pyproject" "setuptools" "flit" "wheel"]; + withDistOutput = lib.elem format' ["pyproject" "setuptools" "wheel"]; name_ = name; @@ -222,8 +220,6 @@ let unzip ] ++ lib.optionals (format' == "setuptools") [ setuptoolsBuildHook - ] ++ lib.optionals (format' == "flit") [ - flitBuildHook ] ++ lib.optionals (format' == "pyproject") [( if isBootstrapPackage then pypaBuildHook.override { diff --git a/nixpkgs/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/nixpkgs/pkgs/development/interpreters/python/python2/mk-python-derivation.nix index e5f9c00b2fb2..d42e4e85c102 100644 --- a/nixpkgs/pkgs/development/interpreters/python/python2/mk-python-derivation.nix +++ b/nixpkgs/pkgs/development/interpreters/python/python2/mk-python-derivation.nix @@ -98,12 +98,10 @@ , ... } @ attrs: -assert lib.assertMsg (format != "flit") "flit is not a supported Python 2 format"; - let inherit (python) stdenv; - withDistOutput = lib.elem format ["pyproject" "setuptools" "flit" "wheel"]; + withDistOutput = lib.elem format ["pyproject" "setuptools" "wheel"]; name_ = name; @@ -171,7 +169,7 @@ let nativeBuildInputs = [ python wrapPython - ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? + ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, ...)? pythonRemoveTestsDirHook ] ++ lib.optionals catchConflicts [ pythonCatchConflictsHook diff --git a/nixpkgs/pkgs/development/interpreters/python/tests.nix b/nixpkgs/pkgs/development/interpreters/python/tests.nix index d2bab1b0c8d3..67670ceb6546 100644 --- a/nixpkgs/pkgs/development/interpreters/python/tests.nix +++ b/nixpkgs/pkgs/development/interpreters/python/tests.nix @@ -8,7 +8,6 @@ { stdenv , python , runCommand -, substituteAll , lib , callPackage , pkgs @@ -60,7 +59,7 @@ let is_nixenv = "True"; is_virtualenv = "False"; }; - } // lib.optionalAttrs (python.isPy3k && (!python.isPyPy)) rec { + } // lib.optionalAttrs (python.isPy3k && (!python.isPyPy)) { # Venv built using plain Python # Python 2 does not support venv # TODO: PyPy executable name is incorrect, it should be pypy-c or pypy-3c instead of pypy and pypy3. @@ -109,7 +108,7 @@ let cpython-gdb = callPackage ./tests/test_cpython_gdb { interpreter = python; }; - } // lib.optionalAttrs (python.pythonAtLeast "3.7") rec { + } // lib.optionalAttrs (python.pythonAtLeast "3.7") { # Before the addition of NIX_PYTHONPREFIX mypy was broken with typed packages nix-pythonprefix-mypy = callPackage ./tests/test_nix_pythonprefix { interpreter = python; @@ -126,7 +125,7 @@ let extension = self: super: { foobar = super.numpy; }; - in { + in lib.optionalAttrs (python.isPy3k) ({ test-packageOverrides = let myPython = let self = python.override { @@ -150,7 +149,7 @@ let ]; }); in pkgs_.${python.pythonAttr}.pkgs.foo; - }; + }); condaTests = let requests = callPackage ({ @@ -178,7 +177,7 @@ let } ) {}; pythonWithRequests = requests.pythonModule.withPackages (ps: [ requests ]); - in lib.optionalAttrs stdenv.isLinux + in lib.optionalAttrs (python.isPy3k && stdenv.isLinux) { condaExamplePackage = runCommand "import-requests" {} '' ${pythonWithRequests.interpreter} -c "import requests" > $out |