From a94804c4510b1566695895b24cbda7418b9071ff Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 Feb 2023 21:55:50 +0000 Subject: [PATCH 1/8] python39: Move out of sources attrset --- .../interpreters/python/default.nix | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 76dc12005f8e..b9f06b0b0117 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -117,15 +117,6 @@ }; sources = { - python39 = { - sourceVersion = { - major = "3"; - minor = "9"; - patch = "16"; - suffix = ""; - }; - sha256 = "sha256-It3cCZJG3SdgZlVh6K23OU6gzEOnJoTGSA+TgPd4ZDk="; - }; python310 = { sourceVersion = { major = "3"; @@ -165,11 +156,18 @@ in { inherit passthruFun; }; - python39 = callPackage ./cpython ({ + python39 = callPackage ./cpython { self = __splicedPackages.python39; + sourceVersion = { + major = "3"; + minor = "9"; + patch = "16"; + suffix = ""; + }; + sha256 = "sha256-It3cCZJG3SdgZlVh6K23OU6gzEOnJoTGSA+TgPd4ZDk="; inherit (darwin) configd; inherit passthruFun; - } // sources.python39); + }; python310 = callPackage ./cpython ({ self = __splicedPackages.python310; From f228b9368b4c65775eb25dbb866fd5bba2ad3800 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 Feb 2023 22:05:47 +0000 Subject: [PATCH 2/8] python310: 3.10.9 -> 3.10.10 https://docs.python.org/release/3.10.10/whatsnew/changelog.html --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index b9f06b0b0117..b6b468eac6f9 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -121,10 +121,10 @@ sourceVersion = { major = "3"; minor = "10"; - patch = "9"; + patch = "10"; suffix = ""; }; - sha256 = "sha256-WuA+MIJgFkuro5kh/bTb+ObQPYI1qTnUWCsz8LXkaoM="; + sha256 = "sha256-BBnpCFv1G3pnIAmz9Q2/GFms3xi6cl0OwZqlyFA/DqM="; }; }; From f0b8e02958c5bec7aff2da38d62e9de7a673a49b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 Feb 2023 23:11:23 +0000 Subject: [PATCH 3/8] python311: 3.11.1 -> 3.11.2 https://docs.python.org/release/3.11.2/whatsnew/changelog.html --- .../interpreters/python/default.nix | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index b6b468eac6f9..59f57ece2b81 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -126,6 +126,16 @@ }; sha256 = "sha256-BBnpCFv1G3pnIAmz9Q2/GFms3xi6cl0OwZqlyFA/DqM="; }; + + python311 = { + sourceVersion = { + major = "3"; + minor = "11"; + patch = "2"; + suffix = ""; + }; + sha256 = "sha256-KeS49fFlhUKowT4t0nc1jJxI8rL3MYZS7xZ15AK50q8="; + }; }; in { @@ -175,18 +185,11 @@ in { inherit passthruFun; } // sources.python310); - python311 = callPackage ./cpython { + python311 = callPackage ./cpython ({ self = __splicedPackages.python311; - sourceVersion = { - major = "3"; - minor = "11"; - patch = "1"; - suffix = ""; - }; - sha256 = "sha256-hYeRkvLP/VbLFsCSkFlJ6/Pl45S392RyNSljeQHftY8="; inherit (darwin) configd; inherit passthruFun; - }; + } // sources.python311); python312 = callPackage ./cpython { self = __splicedPackages.python312; From ee90eca180f2c42afc3b2365ec47e7bc9d90ace5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 Feb 2023 23:18:45 +0000 Subject: [PATCH 4/8] cpython: Migrate sha256 occurences to hash --- .../interpreters/python/cpython/default.nix | 6 ++--- .../interpreters/python/default.nix | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 66566cf5c277..11b6fcbe8cf1 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -30,7 +30,7 @@ , pkgsHostHost , pkgsTargetTarget , sourceVersion -, sha256 +, hash , passthruFun , bash , stripConfig ? false @@ -215,7 +215,7 @@ in with passthru; stdenv.mkDerivation { src = fetchurl { url = with sourceVersion; "https://www.python.org/ftp/python/${major}.${minor}.${patch}/Python-${version}.tar.xz"; - inherit sha256; + inherit hash; }; prePatch = optionalString stdenv.isDarwin '' @@ -235,7 +235,7 @@ in with passthru; stdenv.mkDerivation { url = "https://github.com/python/cpython/commit/3fae04b10e2655a20a3aadb5e0d63e87206d0c67.diff"; revert = true; excludes = [ "Misc/NEWS.d/*" ]; - sha256 = "sha256-PmkXf2D9trtW1gXZilRIWgdg2Y47JfELq1z4DuG3wJY="; + hash = "sha256-PmkXf2D9trtW1gXZilRIWgdg2Y47JfELq1z4DuG3wJY="; }) ] ++ [ # Disable the use of ldconfig in ctypes.util.find_library (since diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 59f57ece2b81..c065e7155b70 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -124,7 +124,7 @@ patch = "10"; suffix = ""; }; - sha256 = "sha256-BBnpCFv1G3pnIAmz9Q2/GFms3xi6cl0OwZqlyFA/DqM="; + hash = "sha256-BBnpCFv1G3pnIAmz9Q2/GFms3xi6cl0OwZqlyFA/DqM="; }; python311 = { @@ -134,7 +134,7 @@ patch = "2"; suffix = ""; }; - sha256 = "sha256-KeS49fFlhUKowT4t0nc1jJxI8rL3MYZS7xZ15AK50q8="; + hash = "sha256-KeS49fFlhUKowT4t0nc1jJxI8rL3MYZS7xZ15AK50q8="; }; }; @@ -148,7 +148,7 @@ in { patch = "18"; suffix = ".6"; # ActiveState's Python 2 extended support }; - sha256 = "sha256-+I0QOBkuTHMIQz71lgNn1X1vjPsjJMtFbgC0xcGTwWY="; + hash = "sha256-+I0QOBkuTHMIQz71lgNn1X1vjPsjJMtFbgC0xcGTwWY="; inherit (darwin) configd; inherit passthruFun; }; @@ -161,7 +161,7 @@ in { patch = "16"; suffix = ""; }; - sha256 = "sha256-2F27N3QTJHPYCB3LFY80oQzK16kLlsflDqS7YfXORWI="; + hash = "sha256-2F27N3QTJHPYCB3LFY80oQzK16kLlsflDqS7YfXORWI="; inherit (darwin) configd; inherit passthruFun; }; @@ -174,7 +174,7 @@ in { patch = "16"; suffix = ""; }; - sha256 = "sha256-It3cCZJG3SdgZlVh6K23OU6gzEOnJoTGSA+TgPd4ZDk="; + hash = "sha256-It3cCZJG3SdgZlVh6K23OU6gzEOnJoTGSA+TgPd4ZDk="; inherit (darwin) configd; inherit passthruFun; }; @@ -199,7 +199,7 @@ in { patch = "0"; suffix = "a5"; }; - sha256 = "sha256-1m73o0L+OjVvnO47uXrcHl+0hA9rbP994P991JX4Mjs="; + hash = "sha256-1m73o0L+OjVvnO47uXrcHl+0hA9rbP994P991JX4Mjs="; inherit (darwin) configd; inherit passthruFun; }; @@ -242,7 +242,7 @@ in { patch = "11"; }; - sha256 = "sha256-ERevtmgx2k6m852NIIR4enRon9AineC+MB+e2bJVCTw="; + hash = "sha256-ERevtmgx2k6m852NIIR4enRon9AineC+MB+e2bJVCTw="; pythonVersion = "2.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = __splicedPackages.pythonInterpreters.pypy27_prebuilt; @@ -259,7 +259,7 @@ in { patch = "11"; }; - sha256 = "sha256-sPMWb7Klqt/VzrnbXN1feSmg7MygK0omwNrgSS98qOo="; + hash = "sha256-sPMWb7Klqt/VzrnbXN1feSmg7MygK0omwNrgSS98qOo="; pythonVersion = "3.9"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = __splicedPackages.pypy27; @@ -271,7 +271,7 @@ in { pypy38 = __splicedPackages.pypy39.override { self = __splicedPackages.pythonInterpreters.pypy38; pythonVersion = "3.8"; - sha256 = "sha256-TWdpv8pzc06GZv1wUDt86wam4lkRDmFzMbs4mcpOYFg="; + hash = "sha256-TWdpv8pzc06GZv1wUDt86wam4lkRDmFzMbs4mcpOYFg="; }; pypy37 = throw "pypy37 has been removed from nixpkgs since it is no longer supported upstream"; # Added 2023-01-04 @@ -285,7 +285,7 @@ in { patch = "11"; }; - sha256 = { + hash = { aarch64-linux = "sha256-6pJNod7+kyXvdg4oiwT5hGFOQFWA9TIetqXI9Tm9QVo="; x86_64-linux = "sha256-uo7ZWKkFwHNaTP/yh1wlCJlU3AIOCH2YKw/6W52jFs0="; aarch64-darwin = "sha256-zFaWq0+TzTSBweSZC13t17pgrAYC+hiQ02iImmxb93E="; @@ -303,7 +303,7 @@ in { minor = "3"; patch = "11"; }; - sha256 = { + hash = { aarch64-linux = "sha256-CRddxlLtiV2Y6a1j0haBK/PufjmNkAqb+espBrqDArk="; x86_64-linux = "sha256-1QYXLKEQcSdBdddOnFgcMWZDLQF5sDZHDjuejSDq5YE="; aarch64-darwin = "sha256-ka11APGjlTHb76CzRaPc/5J/+ZcWVOjS6e98WuMR9X4="; From 20c723dd070792a0e6b56df0e7b173975867ddb3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 11 Feb 2023 23:22:09 +0100 Subject: [PATCH 5/8] python3.tests.condaExamplePackage: Exclude on non-linux Allow python3.tests to eval on other platforms than linux, by excluding conda tests when not on linux, because they include alsa-lib, which is linux-only. --- pkgs/development/interpreters/python/tests.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index 037c8f87b8ba..6282b0f6690e 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -173,7 +173,7 @@ let } ) {}; pythonWithRequests = requests.pythonModule.withPackages (ps: [ requests ]); - in + in lib.optionalAttrs stdenv.isLinux { condaExamplePackage = runCommand "import-requests" {} '' ${pythonWithRequests.interpreter} -c "import requests" > $out From a48dcc5da17e1507549770fdc525aa1bcbc1241e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 12 Feb 2023 00:53:43 +0100 Subject: [PATCH 6/8] python310Packages.asgiref: Fix tests on darwin --- pkgs/development/python-modules/asgiref/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/asgiref/default.nix b/pkgs/development/python-modules/asgiref/default.nix index 72d9a9707323..923ee6bd8198 100644 --- a/pkgs/development/python-modules/asgiref/default.nix +++ b/pkgs/development/python-modules/asgiref/default.nix @@ -35,6 +35,8 @@ buildPythonPackage rec { "test_multiprocessing" ]; + __darwinAllowLocalNetworking = true; + pythonImportsCheck = [ "asgiref" ]; meta = with lib; { From f75329f0bcacebacfdd631fd588eed6419f0ba1c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 12 Feb 2023 01:04:54 +0100 Subject: [PATCH 7/8] python310Packages.ephemeral-port-reserve: Fix tests on darwin --- .../python-modules/ephemeral-port-reserve/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/ephemeral-port-reserve/default.nix b/pkgs/development/python-modules/ephemeral-port-reserve/default.nix index dc3148f36230..76d14e191cac 100644 --- a/pkgs/development/python-modules/ephemeral-port-reserve/default.nix +++ b/pkgs/development/python-modules/ephemeral-port-reserve/default.nix @@ -29,6 +29,8 @@ buildPythonPackage { "test_fqdn" ]; + __darwinAllowLocalNetworking = true; + pythonImportsCheck = [ "ephemeral_port_reserve" ]; From d704ee72c939d6a30dcd1c92bacca2413dbc90fa Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 12 Feb 2023 03:03:31 +0100 Subject: [PATCH 8/8] python3.tests.nixenv-virtualenv: Fix on darwin The virtualenv mode is trying to be smart and checks whether it can write to $out, which for some reason fails on darwin. > virtualenv: error: argument dest: the destination . is not write-able at /nix/store But what does work is creating it in the pwd and moving it to $out, because mv just does what it is told. --- pkgs/development/interpreters/python/tests.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index 6282b0f6690e..4ba1b757c3f6 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -43,7 +43,8 @@ let # Use virtualenv from a Nix env. nixenv-virtualenv = rec { env = runCommand "${python.name}-virtualenv" {} '' - ${pythonVirtualEnv.interpreter} -m virtualenv $out + ${pythonVirtualEnv.interpreter} -m virtualenv venv + mv venv $out ''; interpreter = "${env}/bin/${python.executable}"; is_venv = "False";