From 5c09870c0244bbcf47a84f379e05bf10c7aa3f0d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 00:26:26 +0100 Subject: [PATCH 01/17] python3Packages.setuptools: 57.2.0 -> 60.8.2 --- pkgs/development/python-modules/setuptools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index e748334b5ad16..f02b73a99c643 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -10,7 +10,7 @@ let pname = "setuptools"; - version = "57.2.0"; + version = "60.8.2"; # Create an sdist of setuptools sdist = stdenv.mkDerivation rec { @@ -20,7 +20,7 @@ let owner = "pypa"; repo = pname; rev = "v${version}"; - sha256 = "sha256-zFmndVoATNxfvDsacY+gj5bzIbbd/8ldbsJj4qOawTA="; + sha256 = "1mqpmbn58rx3g24dm6wnllx0xs97ampn2yga3qypqgwnh1nk477i"; name = "${pname}-${version}-source"; }; From 3411fecdd5afe7642aa2015e974881725159204d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 03:53:29 +0100 Subject: [PATCH 02/17] python3Packages.parse-type: 0.5.6 -> 0.6.0 https://github.com/jenisys/parse_type/releases/tag/v0.6.0 --- pkgs/development/python-modules/parse-type/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/parse-type/default.nix b/pkgs/development/python-modules/parse-type/default.nix index 5cfb4b610ce7a..3356853e8ac4a 100644 --- a/pkgs/development/python-modules/parse-type/default.nix +++ b/pkgs/development/python-modules/parse-type/default.nix @@ -8,13 +8,13 @@ buildPythonPackage rec { pname = "parse-type"; - version = "0.5.6"; + version = "0.6.0"; src = fetchFromGitHub { owner = "jenisys"; repo = "parse_type"; rev = "v${version}"; - sha256 = "sha256-CJroqJIi5DpmR8i1lr8OJ+234615PhpVUsqK91XOT3E="; + sha256 = "sha256-v79zzAAwXYoK2N8ZPl1L90qOwMRexAV2wCTMvo4vrSc="; }; propagatedBuildInputs = [ @@ -29,7 +29,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pytest.ini \ --replace "--metadata PACKAGE_UNDER_TEST parse_type" "" \ - --replace "--metadata PACKAGE_VERSION 0.5.6" "" \ + --replace "--metadata PACKAGE_VERSION ${version}" "" \ --replace "--html=build/testing/report.html --self-contained-html" "" \ --replace "--junit-xml=build/testing/report.xml" "" ''; From 31507976bc879492830004338dd847c8bacb0378 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 17:16:38 +0100 Subject: [PATCH 03/17] python3Packages.readme_renderer: disable tests that rely on old distutils behaviour --- pkgs/development/python-modules/readme_renderer/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/readme_renderer/default.nix b/pkgs/development/python-modules/readme_renderer/default.nix index 65ab0cb2682a6..31b0aa39af3d4 100644 --- a/pkgs/development/python-modules/readme_renderer/default.nix +++ b/pkgs/development/python-modules/readme_renderer/default.nix @@ -43,6 +43,12 @@ buildPythonPackage rec { disabledTests = [ # https://github.com/pypa/readme_renderer/issues/221 "test_GFM_" + # Relies on old distutils behaviour removed by setuptools (TypeError: dist must be a Distribution instance) + "test_valid_rst" + "test_invalid_rst" + "test_malicious_rst" + "test_invalid_missing" + "test_invalid_empty" ]; pythonImportsCheck = [ From 20b0221ec3e97cfce9778df834c7311d34239522 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 17:39:18 +0100 Subject: [PATCH 04/17] python3Packages.pybind11: disable tests that parse setuptools output --- pkgs/development/python-modules/pybind11/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/pybind11/default.nix b/pkgs/development/python-modules/pybind11/default.nix index b776271a7a0b8..8627ca53d54b2 100644 --- a/pkgs/development/python-modules/pybind11/default.nix +++ b/pkgs/development/python-modules/pybind11/default.nix @@ -60,6 +60,8 @@ buildPythonPackage rec { "tests/test_numpy_dtypes.py" # no need to test internal packaging "tests/extra_python_package/test_files.py" + # tests that try to parse setuptools stdout + "tests/extra_setuptools/test_setuphelper.py" ]; meta = with lib; { From f1738923eb0949cd8b14fea258347a770d9d85a4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 22:49:50 +0100 Subject: [PATCH 05/17] python3Packages.async-lru: fix tests --- pkgs/development/python-modules/async-lru/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/async-lru/default.nix b/pkgs/development/python-modules/async-lru/default.nix index 9dc412ccde86d..69e6519b32c3d 100644 --- a/pkgs/development/python-modules/async-lru/default.nix +++ b/pkgs/development/python-modules/async-lru/default.nix @@ -28,6 +28,10 @@ buildPythonPackage rec { pytest-asyncio ]; + pytestFlagsArray = [ + "--asyncio-mode=strict" + ]; + disabledTests = [ # https://github.com/aio-libs/async-lru/issues/341 "test_alru_cache_deco" From e26fba6f34dcf90b715416c67fbdd008d83593ef Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 22:55:09 +0100 Subject: [PATCH 06/17] python3Packages.bitcoin-price-api: drop --- .../bitcoin-price-api/default.nix | 24 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 -- 3 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 pkgs/development/python-modules/bitcoin-price-api/default.nix diff --git a/pkgs/development/python-modules/bitcoin-price-api/default.nix b/pkgs/development/python-modules/bitcoin-price-api/default.nix deleted file mode 100644 index c9d317a81c3c3..0000000000000 --- a/pkgs/development/python-modules/bitcoin-price-api/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi -, python-dateutil, requests }: - -buildPythonPackage rec { - pname = "bitcoin-price-api"; - version = "0.0.4"; - - src = fetchPypi { - inherit pname version; - sha256 = "bc68076f9632aaa9a8009d916d67a709c1e045dd904cfc7a3e8be33960d32029"; - }; - - propagatedBuildInputs = [ python-dateutil requests ]; - - # No tests in archive - doCheck = false; - - meta = { - homepage = "https://github.com/dursk/bitcoin-price-api"; - description = "Price APIs for bitcoin exchanges"; - license = with lib.licenses; [ mit ]; - maintainers = with lib.maintainers; [ bhipple ]; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 4e0f922e168e5..ad8dfaa52c7db 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -35,6 +35,7 @@ in mapAliases ({ anyjson = throw "anyjson has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-01-18 asyncio-nats-client = nats-py; # added 2022-02-08 + bitcoin-price-api = throw "bitcoin-price-api has been removed, it was using setuptools 2to3 translation feautre, which has been removed in setuptools 58"; # added 2022-02-15 blockdiagcontrib-cisco = throw "blockdiagcontrib-cisco is not compatible with blockdiag 2.0.0 and has been removed."; # added 2020-11-29 bt_proximity = bt-proximity; # added 2021-07-02 bugseverywhere = throw "bugseverywhere has been removed: Abandoned by upstream."; # added 2019-11-27 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2f3ba8705a70e..4585db8b1dbd4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1214,8 +1214,6 @@ in { bitcoinlib = callPackage ../development/python-modules/bitcoinlib { }; - bitcoin-price-api = callPackage ../development/python-modules/bitcoin-price-api { }; - bitcoin-utils-fork-minimal = callPackage ../development/python-modules/bitcoin-utils-fork-minimal { }; bitcoinrpc = callPackage ../development/python-modules/bitcoinrpc { }; From aaf81c378c85b62e1836fec88e3bfb0b4c72f00e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Feb 2022 23:37:46 +0100 Subject: [PATCH 07/17] python3Packages.django-widget-tweaks: fix build and update tests --- .../django-widget-tweaks/default.nix | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/django-widget-tweaks/default.nix b/pkgs/development/python-modules/django-widget-tweaks/default.nix index 63e575b634549..5fd29de16107d 100644 --- a/pkgs/development/python-modules/django-widget-tweaks/default.nix +++ b/pkgs/development/python-modules/django-widget-tweaks/default.nix @@ -1,4 +1,16 @@ -{ buildPythonPackage, fetchFromGitHub, python, lib, django }: +{ lib +, buildPythonPackage +, fetchFromGitHub + +# native +, setuptools-scm + +# propagated +, django + +# tests +, python +}: buildPythonPackage rec { pname = "django-widget-tweaks"; @@ -11,15 +23,26 @@ buildPythonPackage rec { sha256 = "1rhn2skx287k6nnkxlwvl9snbia6w6z4c2rqg22hwzbz5w05b24h"; }; - checkPhase = "${python.interpreter} runtests.py"; - propagatedBuildInputs = [ django ]; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + django + ]; + + checkPhase = '' + ${python.interpreter} -m django test --settings=tests.settings + ''; meta = with lib; { - description = "Tweak the form field rendering in templates, not in python-level form definitions."; - homepage = "https://github.com/jazzband/django-widget-tweaks"; - license = licenses.mit; - maintainers = with maintainers; [ - maxxk - ]; + description = "Tweak the form field rendering in templates, not in python-level form definitions."; + homepage = "https://github.com/jazzband/django-widget-tweaks"; + license = licenses.mit; + maintainers = with maintainers; [ + maxxk + ]; }; } From a98f94fcf3bc4b096d666211b39798e6cae9ff0c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 16 Feb 2022 00:11:41 +0100 Subject: [PATCH 08/17] python3Packages.hypothesmith: patch lark requirement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The library was renamed and this package didn't follow … yet? --- pkgs/development/python-modules/hypothesmith/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/hypothesmith/default.nix b/pkgs/development/python-modules/hypothesmith/default.nix index 3ce0f068fec9f..d1a6625e8c7bb 100644 --- a/pkgs/development/python-modules/hypothesmith/default.nix +++ b/pkgs/development/python-modules/hypothesmith/default.nix @@ -9,6 +9,11 @@ buildPythonPackage rec { sha256 = "0fb7b3fd03d76eddd4474b0561e1c2662457593a74cc300fd27e5409cd4d7922"; }; + postPatch = '' + substituteInPlace setup.py \ + --replace "lark-parser" "lark" + ''; + propagatedBuildInputs = [ hypothesis lark libcst ]; checkInputs = [ black parso pytestCheckHook pytest-cov pytest-xdist ]; From bef19b759f000cd0b2c83665f621cc54c4430188 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 16 Feb 2022 00:23:00 +0100 Subject: [PATCH 09/17] python3Packages.hypothesmith: configure parallel build Including pytest-xdist without configuring it has no effect... --- pkgs/development/python-modules/hypothesmith/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/hypothesmith/default.nix b/pkgs/development/python-modules/hypothesmith/default.nix index d1a6625e8c7bb..8fe65b3f4d7bf 100644 --- a/pkgs/development/python-modules/hypothesmith/default.nix +++ b/pkgs/development/python-modules/hypothesmith/default.nix @@ -18,6 +18,10 @@ buildPythonPackage rec { checkInputs = [ black parso pytestCheckHook pytest-cov pytest-xdist ]; + pytestFlagsArray = [ + "--numprocesses $NIX_BUILD_CORES" + ]; + pythonImportsCheck = [ "hypothesmith" ]; meta = with lib; { From 83c88278c3c845d7183c3280ce975a6d36f375eb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 16 Feb 2022 01:27:27 +0100 Subject: [PATCH 10/17] isso: fix check phase --- pkgs/servers/isso/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/isso/default.nix b/pkgs/servers/isso/default.nix index f02fc8df3b1bd..4368663ef796e 100644 --- a/pkgs/servers/isso/default.nix +++ b/pkgs/servers/isso/default.nix @@ -50,7 +50,9 @@ with python3Packages; buildPythonApplication rec { checkInputs = [ nose ]; checkPhase = '' - ${python.interpreter} setup.py nosetests + runHook preCheck + ${python.interpreter} -m nose + runHook postCheck ''; passthru.tests = { inherit (nixosTests) isso; }; From 3ee7104971a9b0f62a4ab118e6158846cf93c106 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 15 Feb 2022 16:38:11 -0800 Subject: [PATCH 11/17] python3Packages.portalocker: disable setuptools sensitive test --- pkgs/development/python-modules/portalocker/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/portalocker/default.nix b/pkgs/development/python-modules/portalocker/default.nix index 357ca815407fa..cd7d6d03bbd4c 100644 --- a/pkgs/development/python-modules/portalocker/default.nix +++ b/pkgs/development/python-modules/portalocker/default.nix @@ -22,6 +22,10 @@ buildPythonPackage rec { pytest-mypy ]; + disabledTests = [ + "test_combined" # no longer compatible with setuptools>=58 + ]; + meta = with lib; { description = "A library to provide an easy API to file locking"; homepage = "https://github.com/WoLpH/portalocker"; From 42dea375bc96ab86fd0f6799d6169ae3800773ac Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 15 Feb 2022 16:43:20 -0800 Subject: [PATCH 12/17] python3Packages.keepalive: mark brokenk for setuptools>=58 --- pkgs/development/python-modules/keepalive/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/keepalive/default.nix b/pkgs/development/python-modules/keepalive/default.nix index b6daec6ca2006..6a4fcdb265f47 100644 --- a/pkgs/development/python-modules/keepalive/default.nix +++ b/pkgs/development/python-modules/keepalive/default.nix @@ -19,6 +19,7 @@ buildPythonPackage rec { description = "An HTTP handler for `urllib2` that supports HTTP 1.1 and keepalive"; homepage = "https://github.com/wikier/keepalive"; license = licenses.asl20; + broken = true; # uses use_2to3, which is no longer supported for setuptools>=58 }; } From 4ecb548a6b737755ee50bb234432d89b90c6b0e7 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 15 Feb 2022 16:44:31 -0800 Subject: [PATCH 13/17] python3Packages.parameterizedtestcase: mark brokenk for setuptools>=58 --- .../development/python-modules/parameterizedtestcase/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/parameterizedtestcase/default.nix b/pkgs/development/python-modules/parameterizedtestcase/default.nix index 20e662cd66d61..9d277af8d1a9c 100644 --- a/pkgs/development/python-modules/parameterizedtestcase/default.nix +++ b/pkgs/development/python-modules/parameterizedtestcase/default.nix @@ -27,5 +27,6 @@ buildPythonPackage rec { homepage = "https://github.com/msabramo/python_unittest_parameterized_test_case"; license = licenses.mit; maintainers = with maintainers; [ dotlambda ]; + broken = python.isPy3k; # uses use_2to3 }; } From 4cc256f221c0c346ecd56333e8c36fd32b23369b Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 15 Feb 2022 17:14:50 -0800 Subject: [PATCH 14/17] azure-cli: fix build --- pkgs/tools/admin/azure-cli/python-packages.nix | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkgs/tools/admin/azure-cli/python-packages.nix b/pkgs/tools/admin/azure-cli/python-packages.nix index d27805bb257e4..9fbb9d3e50a28 100644 --- a/pkgs/tools/admin/azure-cli/python-packages.nix +++ b/pkgs/tools/admin/azure-cli/python-packages.nix @@ -481,18 +481,6 @@ let }; }); - PyGithub = super.PyGithub.overridePythonAttrs(oldAttrs: rec { - version = "1.38"; - - src = super.fetchPypi { - inherit (oldAttrs) pname; - inherit version; - sha256 = "sha256-HtCPd17FBnvIRStyveLbuVz05S/yvVDMMsackf+tknI="; - }; - - doCheck = false; - }); - knack = super.knack.overridePythonAttrs(oldAttrs: rec { version = "0.9.0"; From 4b2b144dfe8dc1c925ed76fbe0446cb5efa61e71 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 16 Feb 2022 16:01:33 +0100 Subject: [PATCH 15/17] python3Packages.nose-cover3: drop --- .../python-modules/nose-cover3/default.nix | 27 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 -- 3 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 pkgs/development/python-modules/nose-cover3/default.nix diff --git a/pkgs/development/python-modules/nose-cover3/default.nix b/pkgs/development/python-modules/nose-cover3/default.nix deleted file mode 100644 index b75dcc526c5fd..0000000000000 --- a/pkgs/development/python-modules/nose-cover3/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ lib -, buildPythonPackage -, fetchPypi -, nose -}: - -buildPythonPackage rec { - pname = "nose-cover3"; - version = "0.1.0"; - - src = fetchPypi { - inherit pname version; - sha256 = "1la4hhc1yszjpcchvkqk5xmzlb2g1b3fgxj9wwc58qc549whlcc1"; - }; - - propagatedBuildInputs = [ nose ]; - - # No tests included - doCheck = false; - - meta = with lib; { - description = "Coverage 3.x support for Nose"; - homepage = "https://github.com/ask/nosecover3"; - license = licenses.lgpl21; - }; - -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index ad8dfaa52c7db..06ea055ef5b1a 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -74,6 +74,7 @@ mapAliases ({ lammps-cython = throw "lammps-cython no longer builds and is unmaintained"; # added 2021-07-04 Markups = markups; # added 2022-02-14 MechanicalSoup = mechanicalsoup; # added 2021-06-01 + nose-cover3 = throw "nose-cover3 has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-02-16 pam = python-pam; # added 2020-09-07. PasteDeploy = pastedeploy; # added 2021-10-07 powerlineMemSegment = powerline-mem-segment; # added 2021-10-08 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4585db8b1dbd4..87685cce92d6b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5540,8 +5540,6 @@ in { nose-cov = callPackage ../development/python-modules/nose-cov { }; - nose-cover3 = callPackage ../development/python-modules/nose-cover3 { }; - nose-cprof = callPackage ../development/python-modules/nose-cprof { }; nose-exclude = callPackage ../development/python-modules/nose-exclude { }; From 73726ba87d5651f8cc318deceb6225bde35c5944 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Fri, 18 Feb 2022 20:11:29 +0000 Subject: [PATCH 16/17] python3Packages.setuptools: add patch for bundled distutils c++ support setuptools 60.x (re-)introduces a bundled distutils, which we need to patch with C++ support in the same way as we do with the stdlib's distutils (mostly to placate clang on macos) --- .../python-modules/setuptools/default.nix | 1 + .../setuptools/setuptools-distutils-C++.patch | 216 ++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index f02b73a99c643..6b18422cc18a6 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -26,6 +26,7 @@ let patches = [ ./tag-date.patch + ./setuptools-distutils-C++.patch ]; buildPhase = '' diff --git a/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch b/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch new file mode 100644 index 0000000000000..a14e514fda7ed --- /dev/null +++ b/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch @@ -0,0 +1,216 @@ +Based on pkgs/development/interpreters/python/cpython/3.7/python-3.x-distutils-C++.patch, +adapted to apply to setuptools 60.x's bundled distutils. + +diff --git a/setuptools/_distutils/cygwinccompiler.py b/setuptools/_distutils/cygwinccompiler.py +index c5c86d8f..b879e447 100644 +--- a/setuptools/_distutils/cygwinccompiler.py ++++ b/setuptools/_distutils/cygwinccompiler.py +@@ -124,14 +124,19 @@ class CygwinCCompiler(UnixCCompiler): + self.cxx = os.environ.get('CXX', 'g++') + + self.linker_dll = self.cc ++ self.linker_dll_cxx = self.cxx + shared_option = "-shared" + + self.set_executables(compiler='%s -mcygwin -O -Wall' % self.cc, + compiler_so='%s -mcygwin -mdll -O -Wall' % self.cc, + compiler_cxx='%s -mcygwin -O -Wall' % self.cxx, ++ compiler_so_cxx='%s -mcygwin -mdll -O -Wall' % self.cxx, + linker_exe='%s -mcygwin' % self.cc, + linker_so=('%s -mcygwin %s' % +- (self.linker_dll, shared_option))) ++ (self.linker_dll, shared_option)), ++ linker_exe_cxx='%s -mcygwin' % self.cxx, ++ linker_so_cxx=('%s -mcygwin %s' % ++ (self.linker_dll_cxx, shared_option))) + + # Include the appropriate MSVC runtime library if Python was built + # with MSVC 7.0 or later. +@@ -162,8 +167,12 @@ class CygwinCCompiler(UnixCCompiler): + raise CompileError(msg) + else: # for other files use the C-compiler + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError as msg: + raise CompileError(msg) + +@@ -279,9 +288,13 @@ class Mingw32CCompiler(CygwinCCompiler): + self.set_executables(compiler='%s -O -Wall' % self.cc, + compiler_so='%s -mdll -O -Wall' % self.cc, + compiler_cxx='%s -O -Wall' % self.cxx, ++ compiler_so_cxx='%s -mdll -O -Wall' % self.cxx, + linker_exe='%s' % self.cc, + linker_so='%s %s' +- % (self.linker_dll, shared_option)) ++ % (self.linker_dll, shared_option), ++ linker_exe_cxx='%s' % self.cxx, ++ linker_so_cxx='%s %s' ++ % (self.linker_dll_cxx, shared_option)) + + # Maybe we should also append -mthreads, but then the finished + # dlls need another dll (mingwm10.dll see Mingw32 docs) +diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py +index 4a77a431..1ad85181 100644 +--- a/setuptools/_distutils/sysconfig.py ++++ b/setuptools/_distutils/sysconfig.py +@@ -216,9 +216,11 @@ def customize_compiler(compiler): + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' + +- (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ +- get_config_vars('CC', 'CXX', 'CFLAGS', +- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') ++ (cc, cxx, cflags, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \ ++ get_config_vars('CC', 'CXX', 'CFLAGS', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') ++ ++ cxxflags = cflags + + if 'CC' in os.environ: + newcc = os.environ['CC'] +@@ -232,19 +234,27 @@ def customize_compiler(compiler): + cxx = os.environ['CXX'] + if 'LDSHARED' in os.environ: + ldshared = os.environ['LDSHARED'] ++ if 'LDCXXSHARED' in os.environ: ++ ldcxxshared = os.environ['LDCXXSHARED'] + if 'CPP' in os.environ: + cpp = os.environ['CPP'] + else: + cpp = cc + " -E" # not always + if 'LDFLAGS' in os.environ: + ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] + if 'CFLAGS' in os.environ: +- cflags = cflags + ' ' + os.environ['CFLAGS'] ++ cflags = os.environ['CFLAGS'] + ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ if 'CXXFLAGS' in os.environ: ++ cxxflags = os.environ['CXXFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] + if 'CPPFLAGS' in os.environ: + cpp = cpp + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] + ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: +@@ -253,13 +263,17 @@ def customize_compiler(compiler): + archiver = ar + ' ' + ar_flags + + cc_cmd = cc + ' ' + cflags ++ cxx_cmd = cxx + ' ' + cxxflags + compiler.set_executables( + preprocessor=cpp, + compiler=cc_cmd, + compiler_so=cc_cmd + ' ' + ccshared, +- compiler_cxx=cxx, ++ compiler_cxx=cxx_cmd, ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, + linker_so=ldshared, + linker_exe=cc, ++ linker_so_cxx=ldcxxshared, ++ linker_exe_cxx=cxx, + archiver=archiver) + + if 'RANLIB' in os.environ and compiler.executables.get('ranlib', None): +diff --git a/setuptools/_distutils/unixccompiler.py b/setuptools/_distutils/unixccompiler.py +index a07e5988..576ef490 100644 +--- a/setuptools/_distutils/unixccompiler.py ++++ b/setuptools/_distutils/unixccompiler.py +@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler): + # are pretty generic; they will probably have to be set by an outsider + # (eg. using information discovered by the sysconfig about building + # Python extensions). +- executables = {'preprocessor' : None, +- 'compiler' : ["cc"], +- 'compiler_so' : ["cc"], +- 'compiler_cxx' : ["cc"], +- 'linker_so' : ["cc", "-shared"], +- 'linker_exe' : ["cc"], +- 'archiver' : ["ar", "-cr"], +- 'ranlib' : None, ++ executables = {'preprocessor' : None, ++ 'compiler' : ["cc"], ++ 'compiler_so' : ["cc"], ++ 'compiler_cxx' : ["c++"], ++ 'compiler_so_cxx' : ["c++"], ++ 'linker_so' : ["cc", "-shared"], ++ 'linker_exe' : ["cc"], ++ 'linker_so_cxx' : ["c++", "-shared"], ++ 'linker_exe_cxx' : ["c++"], ++ 'archiver' : ["ar", "-cr"], ++ 'ranlib' : None, + } + + if sys.platform[:6] == "darwin": +@@ -110,12 +113,19 @@ class UnixCCompiler(CCompiler): + + def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): + compiler_so = self.compiler_so ++ compiler_so_cxx = self.compiler_so_cxx + if sys.platform == 'darwin': + compiler_so = _osx_support.compiler_fixup(compiler_so, + cc_args + extra_postargs) ++ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, ++ cc_args + extra_postargs) + try: +- self.spawn(compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError as msg: + raise CompileError(msg) + +@@ -173,30 +183,16 @@ class UnixCCompiler(CCompiler): + ld_args.extend(extra_postargs) + self.mkpath(os.path.dirname(output_filename)) + try: +- if target_desc == CCompiler.EXECUTABLE: +- linker = self.linker_exe[:] ++ if target_lang == "c++": ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe_cxx[:] ++ else: ++ linker = self.linker_so_cxx[:] + else: +- linker = self.linker_so[:] +- if target_lang == "c++" and self.compiler_cxx: +- # skip over environment variable settings if /usr/bin/env +- # is used to set up the linker's environment. +- # This is needed on OSX. Note: this assumes that the +- # normal and C++ compiler have the same environment +- # settings. +- i = 0 +- if os.path.basename(linker[0]) == "env": +- i = 1 +- while '=' in linker[i]: +- i += 1 +- +- if os.path.basename(linker[i]) == 'ld_so_aix': +- # AIX platforms prefix the compiler with the ld_so_aix +- # script, so we need to adjust our linker index +- offset = 1 ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe[:] + else: +- offset = 0 +- +- linker[i+offset] = self.compiler_cxx[i] ++ linker = self.linker_so[:] + + if sys.platform == 'darwin': + linker = _osx_support.compiler_fixup(linker, ld_args) From 01667337f1a397fab9ac234eac1f975d37d482f4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 2 Mar 2022 21:26:09 +0100 Subject: [PATCH 17/17] release-python.nix: add buildcatrust to tested set This is the tool that manages our certificate store. --- pkgs/top-level/release-python.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/release-python.nix b/pkgs/top-level/release-python.nix index d90be7f3bb4c9..f341857222014 100644 --- a/pkgs/top-level/release-python.nix +++ b/pkgs/top-level/release-python.nix @@ -35,11 +35,12 @@ let name = "python-tested"; meta.description = "Release-critical packages from the python package sets"; constituents = [ - jobs.remarshal.x86_64-linux # Used in pkgs.formats helper - jobs.python39Packages.colorama.x86_64-linux # Used in nixos test-driver - jobs.python39Packages.ptpython.x86_64-linux # Used in nixos test-driver - jobs.python39Packages.requests.x86_64-linux # Almost ubiquous package - jobs.python39Packages.sphinx.x86_64-linux # Document creation for many packages + jobs.remarshal.x86_64-linux # Used in pkgs.formats helper + jobs.python39Packages.buildcatrust.x86_64-linux # Used in pkgs.cacert + jobs.python39Packages.colorama.x86_64-linux # Used in nixos test-driver + jobs.python39Packages.ptpython.x86_64-linux # Used in nixos test-driver + jobs.python39Packages.requests.x86_64-linux # Almost ubiquous package + jobs.python39Packages.sphinx.x86_64-linux # Document creation for many packages ]; };