From df74f34c6d96397fd8028901d5225bcb827938c4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 01:05:54 +0200 Subject: [PATCH 01/43] python312Packages.glyphtools: disable tests The setup.py test command has been removed. This package had no tests in the first place, so we reach partiy by import testing the module. --- .../development/python-modules/glyphtools/default.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/glyphtools/default.nix b/pkgs/development/python-modules/glyphtools/default.nix index c5c407ed9767..814c7a74d037 100644 --- a/pkgs/development/python-modules/glyphtools/default.nix +++ b/pkgs/development/python-modules/glyphtools/default.nix @@ -5,7 +5,6 @@ beziers, glyphslib, numpy, - setuptoolsCheckHook, }: buildPythonPackage rec { @@ -25,12 +24,10 @@ buildPythonPackage rec { ]; # A unit test suite does exist, but it only contains a dummy test that - # doesn't test anything. It does import the module though so we still run it. - doCheck = true; - nativeCheckInputs = [ - # Upstream apparently prefers the deprecated setuptools 'test' command. - setuptoolsCheckHook - ]; + # imports the library. + doCheck = false; + + pythonImportsCheck = [ "glyphtools" ]; meta = with lib; { description = "Python library for extracting information from font glyphs"; From 471d15382485e4ea6c2f2cdbd6377d37304c5228 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 02:06:53 +0200 Subject: [PATCH 02/43] whipper: test with pytest --- pkgs/applications/audio/whipper/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/whipper/default.nix b/pkgs/applications/audio/whipper/default.nix index 179bb9666085..b6ff1f45440c 100644 --- a/pkgs/applications/audio/whipper/default.nix +++ b/pkgs/applications/audio/whipper/default.nix @@ -21,6 +21,7 @@ let in python3.pkgs.buildPythonApplication rec { pname = "whipper"; version = "0.10.0"; + pyproject = true; src = fetchFromGitHub { owner = "whipper-team"; @@ -38,14 +39,15 @@ in python3.pkgs.buildPythonApplication rec { }) ]; - nativeBuildInputs = with python3.pkgs; [ + nativeBuildInputs = [ installShellFiles wrapGAppsNoGuiHook gobject-introspection + ]; - setuptools-scm + build-system = with python3.pkgs; [ docutils - setuptoolsCheckHook + setuptools-scm ]; propagatedBuildInputs = with python3.pkgs; [ @@ -63,6 +65,7 @@ in python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ twisted + pytestCheckHook ] ++ bins; makeWrapperArgs = [ From c4a5a7dd972ed1e3e8ff4c210bae8584d844ca50 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 02:07:06 +0200 Subject: [PATCH 03/43] python312Packages.pycdio: fix tests on 3.12 --- pkgs/development/python-modules/pycdio/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/pycdio/default.nix b/pkgs/development/python-modules/pycdio/default.nix index 78a620eb0dd7..994b6ff390c2 100644 --- a/pkgs/development/python-modules/pycdio/default.nix +++ b/pkgs/development/python-modules/pycdio/default.nix @@ -23,6 +23,8 @@ buildPythonPackage rec { --replace 'library_dirs=library_dirs' 'library_dirs=[dir.decode("utf-8") for dir in library_dirs]' \ --replace 'include_dirs=include_dirs' 'include_dirs=[dir.decode("utf-8") for dir in include_dirs]' \ --replace 'runtime_library_dirs=runtime_lib_dirs' 'runtime_library_dirs=[dir.decode("utf-8") for dir in runtime_lib_dirs]' + substituteInPlace test/test-cdtext.py \ + --replace-fail assertEquals assertEqual ''; preConfigure = '' From 102305ea0b353ad8c1b12670b60cc6ff839d91cb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 04:20:30 +0200 Subject: [PATCH 04/43] python312Packages.apsw: test with pytest --- .../python-modules/apsw/default.nix | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/apsw/default.nix b/pkgs/development/python-modules/apsw/default.nix index cf3879028869..e23aa93ccec7 100644 --- a/pkgs/development/python-modules/apsw/default.nix +++ b/pkgs/development/python-modules/apsw/default.nix @@ -2,8 +2,8 @@ lib, buildPythonPackage, fetchFromGitHub, - python, pythonOlder, + pytestCheckHook, setuptools, sqlite, }: @@ -26,12 +26,19 @@ buildPythonPackage rec { buildInputs = [ sqlite ]; - # Project uses custom test setup to exclude some tests by default, so using pytest - # requires more maintenance - # https://github.com/rogerbinns/apsw/issues/335 - checkPhase = '' - ${python.interpreter} setup.py test - ''; + nativeCheckInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "apsw/tests.py" ]; + + disabledTests = [ + # we don't build the test extension + "testLoadExtension" + "testShell" + "testVFS" + "testVFSWithWAL" + # no lines in errout.txt + "testWriteUnraisable" + ]; pythonImportsCheck = [ "apsw" ]; From 976cb96fe0e7a601f6ac322e9404bfa6466e7306 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 04:21:26 +0200 Subject: [PATCH 05/43] python312Packages.serpent: test with pytest --- pkgs/development/python-modules/serpent/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/serpent/default.nix b/pkgs/development/python-modules/serpent/default.nix index 529eb8bfdfeb..f6ddf5540703 100644 --- a/pkgs/development/python-modules/serpent/default.nix +++ b/pkgs/development/python-modules/serpent/default.nix @@ -2,11 +2,11 @@ lib, buildPythonPackage, fetchPypi, - python, isPy27, enum34, attrs, pytz, + pytestCheckHook, }: buildPythonPackage rec { @@ -24,10 +24,8 @@ buildPythonPackage rec { nativeCheckInputs = [ attrs pytz + pytestCheckHook ]; - checkPhase = '' - ${python.interpreter} setup.py test - ''; meta = with lib; { description = "Simple serialization library based on ast.literal_eval"; From 0b0dd33e0ad51b5059008fdfdfdef1510bc049dd Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 01:03:02 +0200 Subject: [PATCH 06/43] python312Packages.setuptoolsCheckHook: remove The hook relied on the `test` command passed to `setup.py`, which has long been deprecated and finally removed in setuptools 72.0. --- doc/languages-frameworks/python.section.md | 1 - .../interpreters/python/hooks/default.nix | 9 +-------- .../python/hooks/pytest-check-hook.sh | 12 ------------ .../python/hooks/setuptools-check-hook.sh | 18 ------------------ .../python/hooks/unittest-check-hook.sh | 12 ------------ .../python/mk-python-derivation.nix | 9 +-------- .../python/python2/mk-python-derivation.nix | 9 +-------- 7 files changed, 3 insertions(+), 67 deletions(-) delete mode 100644 pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 5a2e2de2edef..e5447d986088 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -475,7 +475,6 @@ are used in [`buildPythonPackage`](#buildpythonpackage-function). See [example usage](#using-pythonrelaxdepshook). - `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder. - `setuptoolsBuildHook` to build a wheel using `setuptools`. -- `setuptoolsCheckHook` to run tests with `python setup.py test`. - `sphinxHook` to build documentation and manpages using Sphinx. - `venvShellHook` to source a Python 3 `venv` at the `venvDir` location. A `venv` is created if it does not yet exist. `postVenvCreation` can be used to diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index c61cd77fc7ec..ca70d452c808 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -200,14 +200,7 @@ in { }; } ./setuptools-build-hook.sh) {}; - setuptoolsCheckHook = callPackage ({ makePythonHook, setuptools }: - makePythonHook { - name = "setuptools-check-hook"; - propagatedBuildInputs = [ setuptools ]; - substitutions = { - inherit pythonCheckInterpreter setuppy; - }; - } ./setuptools-check-hook.sh) {}; + setuptoolsCheckHook = throw "The setuptoolsCheckHook has been removed, since the test command has been removed in setuptools 72.0"; setuptoolsRustBuildHook = callPackage ({ makePythonHook, setuptools-rust }: makePythonHook { diff --git a/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh b/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh index 0f708f888292..06694e79e492 100644 --- a/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh @@ -59,16 +59,4 @@ function pytestCheckPhase() { if [ -z "${dontUsePytestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then echo "Using pytestCheckPhase" preDistPhases+=" pytestCheckPhase" - - # It's almost always the case that setuptoolsCheckPhase should not be ran - # when the pytestCheckHook is being ran - if [ -z "${useSetuptoolsCheck-}" ]; then - dontUseSetuptoolsCheck=1 - - # Remove command if already injected into preDistPhases - if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then - echo "Removing setuptoolsCheckPhase" - preDistPhases=${preDistPhases/setuptoolsCheckPhase/} - fi - fi fi diff --git a/pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh deleted file mode 100644 index 88b7b11931b0..000000000000 --- a/pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Setup hook for setuptools. -echo "Sourcing setuptools-check-hook" - -setuptoolsCheckPhase() { - echo "Executing setuptoolsCheckPhase" - runHook preCheck - - cp -f @setuppy@ nix_run_setup - @pythonCheckInterpreter@ nix_run_setup test - - runHook postCheck - echo "Finished executing setuptoolsCheckPhase" -} - -if [ -z "${dontUseSetuptoolsCheck-}" ] && [ -z "${installCheckPhase-}" ]; then - echo "Using setuptoolsCheckPhase" - preDistPhases+=" setuptoolsCheckPhase" -fi diff --git a/pkgs/development/interpreters/python/hooks/unittest-check-hook.sh b/pkgs/development/interpreters/python/hooks/unittest-check-hook.sh index 3485fcc79452..f4bd34747730 100644 --- a/pkgs/development/interpreters/python/hooks/unittest-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/unittest-check-hook.sh @@ -14,16 +14,4 @@ unittestCheckPhase() { if [ -z "${dontUseUnittestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then echo "Using unittestCheckPhase" preDistPhases+=" unittestCheckPhase" - - # It's almost always the case that setuptoolsCheckPhase should not be ran - # when the unittestCheckHook is being ran - if [ -z "${useSetuptoolsCheck-}" ]; then - dontUseSetuptoolsCheck=1 - - # Remove command if already injected into preDistPhases - if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then - echo "Removing setuptoolsCheckPhase" - preDistPhases=${preDistPhases/setuptoolsCheckPhase/} - fi - fi fi diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 0d6ab2224991..d75fea0eaef1 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -22,7 +22,6 @@ , pythonRemoveTestsDirHook , pythonRuntimeDepsCheckHook , setuptoolsBuildHook -, setuptoolsCheckHook , wheelUnpackHook , eggUnpackHook , eggBuildHook @@ -313,13 +312,7 @@ let # Python packages don't have a checkPhase, only an installCheckPhase doCheck = false; doInstallCheck = attrs.doCheck or true; - nativeInstallCheckInputs = [ - ] ++ optionals (format' == "setuptools") [ - # Longer-term we should get rid of this and require - # users of this function to set the `installCheckPhase` or - # pass in a hook that sets it. - setuptoolsCheckHook - ] ++ nativeCheckInputs; + nativeInstallCheckInputs = nativeCheckInputs; installCheckInputs = checkInputs; postFixup = optionalString (!dontWrapPythonPrograms) '' diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix index d0d8a9d0dca8..0fb6a5d57f22 100644 --- a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix @@ -19,7 +19,6 @@ , pythonRemoveBinBytecodeHook , pythonRemoveTestsDirHook , setuptoolsBuildHook -, setuptoolsCheckHook , wheelUnpackHook , eggUnpackHook , eggBuildHook @@ -210,13 +209,7 @@ let # Python packages don't have a checkPhase, only an installCheckPhase doCheck = false; doInstallCheck = attrs.doCheck or true; - nativeInstallCheckInputs = [ - ] ++ lib.optionals (format == "setuptools") [ - # Longer-term we should get rid of this and require - # users of this function to set the `installCheckPhase` or - # pass in a hook that sets it. - setuptoolsCheckHook - ] ++ nativeCheckInputs; + nativeInstallCheckInputs = nativeCheckInputs; installCheckInputs = checkInputs; postFixup = lib.optionalString (!dontWrapPythonPrograms) '' From 9253653383e968abc638d54b3b9866d7c8355dca Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 30 Jul 2024 02:24:22 +0200 Subject: [PATCH 07/43] python312Packages.setuptools: 70.0.0 -> 72.1.0 https://setuptools.pypa.io/en/stable/history.html#v72-1-0 --- .../python-modules/setuptools/default.nix | 4 +- .../setuptools/setuptools-distutils-C++.patch | 53 +++++++++---------- .../python-modules/setuptools/tag-date.patch | 7 +-- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index 9614680b08f8..7882a9363860 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "setuptools"; - version = "70.0.0"; + version = "72.1.0"; format = "pyproject"; src = fetchFromGitHub { owner = "pypa"; repo = "setuptools"; rev = "refs/tags/v${version}"; - hash = "sha256-LXF3R9zfWylvihP2M8N94/IlgifwxUwKJFhtvcXEPB0="; + hash = "sha256-3Hm9HxJdSmyhHtDZeMF76HaR17vZwZWYYhS6Z0nA8rU="; }; patches = [ diff --git a/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch b/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch index 16dfd34c2def..10eae862de8a 100644 --- a/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch +++ b/pkgs/development/python-modules/setuptools/setuptools-distutils-C++.patch @@ -1,8 +1,8 @@ diff --git a/setuptools/_distutils/cygwinccompiler.py b/setuptools/_distutils/cygwinccompiler.py -index 539f09d8f..a3d3020cb 100644 +index 7b812fd05..c122a4318 100644 --- a/setuptools/_distutils/cygwinccompiler.py +++ b/setuptools/_distutils/cygwinccompiler.py -@@ -99,14 +99,19 @@ class CygwinCCompiler(UnixCCompiler): +@@ -99,14 +99,18 @@ class CygwinCCompiler(UnixCCompiler): self.cxx = os.environ.get('CXX', 'g++') self.linker_dll = self.cc @@ -10,19 +10,18 @@ index 539f09d8f..a3d3020cb 100644 shared_option = "-shared" self.set_executables( - compiler='%s -mcygwin -O -Wall' % self.cc, - compiler_so='%s -mcygwin -mdll -O -Wall' % self.cc, -+ compiler_so_cxx='%s -mcygwin -mdll -O -Wall' % self.cxx, - compiler_cxx='%s -mcygwin -O -Wall' % self.cxx, - linker_exe='%s -mcygwin' % self.cc, + compiler=f'{self.cc} -mcygwin -O -Wall', + compiler_so=f'{self.cc} -mcygwin -mdll -O -Wall', ++ compiler_so_cxx=f'{self.cxx} -mcygwin -mdll -O -Wall', + compiler_cxx=f'{self.cxx} -mcygwin -O -Wall', + linker_exe=f'{self.cc} -mcygwin', linker_so=(f'{self.linker_dll} -mcygwin {shared_option}'), -+ linker_exe_cxx='%s -mcygwin' % self.cxx, -+ linker_so_cxx=('%s -mcygwin %s' % -+ (self.linker_dll_cxx, shared_option)), ++ linker_exe_cxx=f'{self.cxx} -mcygwin', ++ linker_so_cxx=(f'{self.cxx} -mcygwin {shared_option}'), ) # Include the appropriate MSVC runtime library if Python was built -@@ -138,9 +143,12 @@ class CygwinCCompiler(UnixCCompiler): +@@ -138,9 +142,12 @@ class CygwinCCompiler(UnixCCompiler): raise CompileError(msg) else: # for other files use the C-compiler try: @@ -38,24 +37,24 @@ index 539f09d8f..a3d3020cb 100644 except DistutilsExecError as msg: raise CompileError(msg) -@@ -276,9 +284,12 @@ class Mingw32CCompiler(CygwinCCompiler): +@@ -276,9 +283,12 @@ class Mingw32CCompiler(CygwinCCompiler): self.set_executables( - compiler='%s -O -Wall' % self.cc, - compiler_so='%s -mdll -O -Wall' % self.cc, -+ compiler_so_cxx='%s -mdll -O -Wall' % self.cxx, - compiler_cxx='%s -O -Wall' % self.cxx, - linker_exe='%s' % self.cc, + compiler=f'{self.cc} -O -Wall', + compiler_so=f'{self.cc} -shared -O -Wall', ++ compiler_so_cxx=f'{self.cxx} -mdll -O -Wall', + compiler_cxx=f'{self.cxx} -O -Wall', + linker_exe=f'{self.cc}', linker_so=f'{self.linker_dll} {shared_option}', -+ linker_exe_cxx='%s' % self.cxx, -+ linker_so_cxx='%s %s' % (self.linker_dll_cxx, shared_option) ++ linker_exe_cxx=f'{self.cxx}', ++ linker_so_cxx=f'{self.linker_dll_cxx} {shared_option}', ) def runtime_library_dir_option(self, dir): diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py -index 1a38e9fa7..034ed6566 100644 +index 7ebe67687..a995edf80 100644 --- a/setuptools/_distutils/sysconfig.py +++ b/setuptools/_distutils/sysconfig.py -@@ -300,6 +300,7 @@ def customize_compiler(compiler): # noqa: C901 +@@ -304,6 +304,7 @@ def customize_compiler(compiler): # noqa: C901 cflags, ccshared, ldshared, @@ -63,7 +62,7 @@ index 1a38e9fa7..034ed6566 100644 shlib_suffix, ar, ar_flags, -@@ -309,11 +310,14 @@ def customize_compiler(compiler): # noqa: C901 +@@ -313,11 +314,14 @@ def customize_compiler(compiler): # noqa: C901 'CFLAGS', 'CCSHARED', 'LDSHARED', @@ -78,7 +77,7 @@ index 1a38e9fa7..034ed6566 100644 if 'CC' in os.environ: newcc = os.environ['CC'] if 'LDSHARED' not in os.environ and ldshared.startswith(cc): -@@ -325,19 +329,27 @@ def customize_compiler(compiler): # noqa: C901 +@@ -329,19 +333,27 @@ def customize_compiler(compiler): # noqa: C901 cxx = os.environ['CXX'] if 'LDSHARED' in os.environ: ldshared = os.environ['LDSHARED'] @@ -107,7 +106,7 @@ index 1a38e9fa7..034ed6566 100644 if 'AR' in os.environ: ar = os.environ['AR'] if 'ARFLAGS' in os.environ: -@@ -346,13 +358,17 @@ def customize_compiler(compiler): # noqa: C901 +@@ -350,13 +362,17 @@ def customize_compiler(compiler): # noqa: C901 archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags @@ -127,7 +126,7 @@ index 1a38e9fa7..034ed6566 100644 ) diff --git a/setuptools/_distutils/unixccompiler.py b/setuptools/_distutils/unixccompiler.py -index 0248bde87..9508e6cff 100644 +index 7e68596b2..7214dbd20 100644 --- a/setuptools/_distutils/unixccompiler.py +++ b/setuptools/_distutils/unixccompiler.py @@ -118,9 +118,12 @@ class UnixCCompiler(CCompiler): @@ -144,7 +143,7 @@ index 0248bde87..9508e6cff 100644 'archiver': ["ar", "-cr"], 'ranlib': None, } -@@ -184,8 +187,13 @@ class UnixCCompiler(CCompiler): +@@ -187,8 +190,13 @@ class UnixCCompiler(CCompiler): def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): compiler_so = compiler_fixup(self.compiler_so, cc_args + extra_postargs) @@ -159,7 +158,7 @@ index 0248bde87..9508e6cff 100644 except DistutilsExecError as msg: raise CompileError(msg) -@@ -253,7 +261,8 @@ class UnixCCompiler(CCompiler): +@@ -256,7 +264,8 @@ class UnixCCompiler(CCompiler): # building an executable or linker_so (with shared options) # when building a shared library. building_exe = target_desc == CCompiler.EXECUTABLE diff --git a/pkgs/development/python-modules/setuptools/tag-date.patch b/pkgs/development/python-modules/setuptools/tag-date.patch index 441177a5d17e..30ed812c6740 100644 --- a/pkgs/development/python-modules/setuptools/tag-date.patch +++ b/pkgs/development/python-modules/setuptools/tag-date.patch @@ -1,12 +1,9 @@ diff --git a/setup.cfg b/setup.cfg -index f23714b6..8aaeb330 100644 +index 38922089a..a743a2467 100644 --- a/setup.cfg +++ b/setup.cfg -@@ -1,6 +1,6 @@ +@@ -1,3 +1,3 @@ [egg_info] tag_build = .post -tag_date = 1 +tag_date = 0 - - [aliases] - clean_egg_info = egg_info -Db '' From a65d78dd315e212219c1a7101beefcd73d363d6d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 31 Jul 2024 15:30:34 +0200 Subject: [PATCH 08/43] python312Packages.intervaltree: migrate to pytest and pep517 lingo --- .../python-modules/intervaltree/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/intervaltree/default.nix b/pkgs/development/python-modules/intervaltree/default.nix index a611124c5a5e..eb9511c9e70a 100644 --- a/pkgs/development/python-modules/intervaltree/default.nix +++ b/pkgs/development/python-modules/intervaltree/default.nix @@ -2,30 +2,29 @@ lib, buildPythonPackage, fetchPypi, - python, - pytest, + setuptools, + pytestCheckHook, sortedcontainers, }: buildPythonPackage rec { version = "3.1.0"; - format = "setuptools"; pname = "intervaltree"; + pyproject = true; src = fetchPypi { inherit pname version; sha256 = "902b1b88936918f9b2a19e0e5eb7ccb430ae45cde4f39ea4b36932920d33952d"; }; - buildInputs = [ pytest ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ sortedcontainers ]; + dependencies = [ sortedcontainers ]; - checkPhase = '' - runHook preCheck - rm build -rf - ${python.interpreter} nix_run_setup test - runHook postCheck + nativeCheckInputs = [ pytestCheckHook ]; + + preCheck = '' + rm -rf build ''; meta = with lib; { From ab0e29728635f2c48cd5f3c7b75ee299528c8616 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 31 Jul 2024 16:21:29 +0200 Subject: [PATCH 09/43] python312Packages.scikit-build: 0.17.6 -> 0.18.0 https://github.com/scikit-build/scikit-build/releases/tag/0.18.0 --- .../python-modules/scikit-build/default.nix | 21 ++++------ .../python312-compatibility.patch | 40 ------------------- 2 files changed, 8 insertions(+), 53 deletions(-) delete mode 100644 pkgs/development/python-modules/scikit-build/python312-compatibility.patch diff --git a/pkgs/development/python-modules/scikit-build/default.nix b/pkgs/development/python-modules/scikit-build/default.nix index 2071f2ca4dec..f5c54e856e24 100644 --- a/pkgs/development/python-modules/scikit-build/default.nix +++ b/pkgs/development/python-modules/scikit-build/default.nix @@ -24,27 +24,22 @@ buildPythonPackage rec { pname = "scikit-build"; - version = "0.17.6"; - format = "pyproject"; + version = "0.18.0"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { pname = "scikit_build"; inherit version; - hash = "sha256-tRpRo2s3xCZQmUtQR5EvWbIuMhCyPjIfKHYR+e9uXJ0="; + hash = "sha256-caE69GfRo4UQw0lHhuLttz6tU+qSK95uUZ3FNyqmUJY="; }; patches = [ - # https://github.com/scikit-build/scikit-build/pull/1032 - # https://github.com/scikit-build/scikit-build/issues/1047 - ./python312-compatibility.patch - (fetchpatch2 { - # https://github.com/scikit-build/scikit-build/pull/1073 - name = "skbuild-suppress-permissionerror.patch"; - url = "https://github.com/scikit-build/scikit-build/commit/41183413e4f5ef29cf3d21e470a2cfa2305733f8.patch"; - hash = "sha256-M5Sbt4CBuiAeGgN0D/toglVi1V2GlA9hPIOMzcqOwdo="; + name = "setuptools-70.2.0-compat.patch"; + url = "https://github.com/scikit-build/scikit-build/commit/7005897053bc5c71d823c36bbd89bd43121670f1.patch"; + hash = "sha256-YGNCS1AXnqHQMd40CDePVNAzLe5gQ/nJxASAZafsxK8="; }) ]; @@ -54,13 +49,13 @@ buildPythonPackage rec { sed -i "/'error',/d" pyproject.toml ''; - nativeBuildInputs = [ + build-system = [ hatch-fancy-pypi-readme hatch-vcs hatchling ]; - propagatedBuildInputs = [ + dependencies = [ distro packaging setuptools diff --git a/pkgs/development/python-modules/scikit-build/python312-compatibility.patch b/pkgs/development/python-modules/scikit-build/python312-compatibility.patch deleted file mode 100644 index 8e86eccf010b..000000000000 --- a/pkgs/development/python-modules/scikit-build/python312-compatibility.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/skbuild/resources/cmake/FindPythonExtensions.cmake b/skbuild/resources/cmake/FindPythonExtensions.cmake -index 59b30c2..62298d5 100644 ---- a/skbuild/resources/cmake/FindPythonExtensions.cmake -+++ b/skbuild/resources/cmake/FindPythonExtensions.cmake -@@ -254,19 +254,23 @@ endif() - include(targetLinkLibrariesWithDynamicLookup) - - set(_command " --import distutils.sysconfig -+import sys -+ -+if sys.version_info >= (3,10): -+ import sysconfig -+else: -+ from distutils import sysconfig - import itertools - import os - import os.path - import site --import sys - - result = None - rel_result = None - candidate_lists = [] - - try: -- candidate_lists.append((distutils.sysconfig.get_python_lib(),)) -+ candidate_lists.append((sysconfig.get_python_lib(),)) - except AttributeError: pass - - try: -@@ -293,7 +297,7 @@ sys.stdout.write(\";\".join(( - sys.prefix, - result, - rel_result, -- distutils.sysconfig.get_config_var('EXT_SUFFIX') -+ sysconfig.get_config_var('EXT_SUFFIX') - ))) - ") - From 1b87ff961d8ff66f948735b3e975d170b89353a0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 31 Jul 2024 17:21:51 +0200 Subject: [PATCH 10/43] python312Packages.pytest-fixture-config: patch out tests_require The source is also reused in pytest-server-fixtures, pytest-shutil and pytest-virtualenv, which now inherit the patch. --- .../pytest-fixture-config/default.nix | 8 +- .../setuptools-72.0-compat.patch | 396 ++++++++++++++++++ .../pytest-server-fixtures/default.nix | 8 +- .../python-modules/pytest-shutil/default.nix | 13 +- .../pytest-virtualenv/default.nix | 8 +- 5 files changed, 419 insertions(+), 14 deletions(-) create mode 100644 pkgs/development/python-modules/pytest-fixture-config/setuptools-72.0-compat.patch diff --git a/pkgs/development/python-modules/pytest-fixture-config/default.nix b/pkgs/development/python-modules/pytest-fixture-config/default.nix index ebc3fcdc4ba4..3c94e6de6c98 100644 --- a/pkgs/development/python-modules/pytest-fixture-config/default.nix +++ b/pkgs/development/python-modules/pytest-fixture-config/default.nix @@ -7,7 +7,7 @@ pytest, }: -buildPythonPackage rec { +buildPythonPackage { pname = "pytest-fixture-config"; version = "1.7.1-unstable-2022-10-03"; pyproject = true; @@ -19,7 +19,11 @@ buildPythonPackage rec { hash = "sha256-huN3RzwtfVf4iMJ96VRP/ldOxTUlUMF1wJIdbcGXHn4="; }; - sourceRoot = "${src.name}/pytest-fixture-config"; + patches = [ ./setuptools-72.0-compat.patch ]; + + postPatch = '' + cd pytest-fixture-config + ''; nativeBuildInputs = [ setuptools diff --git a/pkgs/development/python-modules/pytest-fixture-config/setuptools-72.0-compat.patch b/pkgs/development/python-modules/pytest-fixture-config/setuptools-72.0-compat.patch new file mode 100644 index 000000000000..d44180e5957d --- /dev/null +++ b/pkgs/development/python-modules/pytest-fixture-config/setuptools-72.0-compat.patch @@ -0,0 +1,396 @@ +diff --git a/common_setup.py b/common_setup.py +index 002952b..11ca9c9 100644 +--- a/common_setup.py ++++ b/common_setup.py +@@ -1,45 +1,5 @@ + # Common setup.py code shared between all the projects in this repository +-import sys + import os +-import logging +- +-from setuptools.command.test import test as TestCommand +-from setuptools.command.egg_info import egg_info as EggInfoCommand +- +- +-class PyTest(TestCommand): +- pytest_args = [] +- src_dir = None +- +- def initialize_options(self): +- TestCommand.initialize_options(self) +- +- def finalize_options(self): +- TestCommand.finalize_options(self) +- self.test_args = [] +- self.test_suite = True +- +- def run_tests(self): +- global pytest_args +- logging.basicConfig(format='%(asctime)s %(levelname)s %(name)s %(message)s', level='DEBUG') +- +- # import here, cause outside the eggs aren't loaded +- import pytest +- +- self.pytest_args.extend(['--junitxml', 'junit.xml']) +- errno = pytest.main(self.pytest_args) +- sys.exit(errno) +- +- +-class EggInfo(EggInfoCommand): +- """ Customisation of the package metadata creation. Changes are: +- - Save the test requirements into an extra called 'tests' +- """ +- def run(self): +- if self.distribution.extras_require is None: +- self.distribution.extras_require = {} +- self.distribution.extras_require['tests'] = self.distribution.tests_require +- EggInfoCommand.run(self) + + + def common_setup(src_dir): +@@ -57,13 +17,6 @@ def common_setup(src_dir): + long_description = open(readme_file).read() + changelog = open(changelog_file).read() + +- # Gather trailing arguments for pytest, this can't be done using setuptools' api +- if 'test' in sys.argv: +- PyTest.pytest_args = sys.argv[sys.argv.index('test') + 1:] +- if PyTest.pytest_args: +- sys.argv = sys.argv[:-len(PyTest.pytest_args)] +- PyTest.src_dir = src_dir +- + return dict( + # Version is shared between all the projects in this repo + version=open(version_file).read().strip(), +@@ -71,6 +24,5 @@ def common_setup(src_dir): + url='https://github.com/manahl/pytest-plugins', + license='MIT license', + platforms=['unix', 'linux'], +- cmdclass={'test': PyTest, 'egg_info': EggInfo}, + include_package_data=True + ) +diff --git a/pytest-devpi-server/setup.py b/pytest-devpi-server/setup.py +index 8891130..22b460f 100644 +--- a/pytest-devpi-server/setup.py ++++ b/pytest-devpi-server/setup.py +@@ -27,8 +27,6 @@ install_requires = ['pytest-server-fixtures', + 'ruamel.yaml>=0.15;python_version > "3.4"', + ] + +-tests_require = [] +- + entry_points = { + 'pytest11': [ + 'devpi_server = _pytest_devpi_server', +@@ -44,7 +42,6 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, + packages=find_packages(exclude='tests'), + entry_points=entry_points, + )) +diff --git a/pytest-fixture-config/setup.py b/pytest-fixture-config/setup.py +index 164ad33..15a9e16 100644 +--- a/pytest-fixture-config/setup.py ++++ b/pytest-fixture-config/setup.py +@@ -20,8 +20,9 @@ classifiers = [ + + install_requires = ['pytest'] + +-tests_require = ['six', +- ] ++extras_require = { ++ 'test': ["six"] ++} + + if __name__ == '__main__': + kwargs = common_setup('pytest_fixture_config') +@@ -32,7 +33,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_fixture_config'], + )) + setup(**kwargs) +diff --git a/pytest-git/setup.py b/pytest-git/setup.py +index 8f4a1d3..9c4557a 100644 +--- a/pytest-git/setup.py ++++ b/pytest-git/setup.py +@@ -27,9 +27,6 @@ install_requires = ['pytest', + 'gitpython', + ] + +-tests_require = [ +- ] +- + entry_points = { + 'pytest11': [ + 'git_repo = pytest_git', +@@ -46,7 +43,6 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, + py_modules=['pytest_git'], + entry_points=entry_points, + )) +diff --git a/pytest-listener/setup.py b/pytest-listener/setup.py +index 3ce8897..dcde454 100644 +--- a/pytest-listener/setup.py ++++ b/pytest-listener/setup.py +@@ -23,8 +23,6 @@ install_requires = ['six', + 'pytest-server-fixtures' + ] + +-tests_require = [] +- + entry_points = { + 'pytest11': [ + 'listener = pytest_listener', +@@ -40,7 +38,6 @@ if __name__ == '__main__': + author_email='drtimcouper@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, + packages=find_packages(exclude='tests'), + entry_points=entry_points, + )) +diff --git a/pytest-profiling/setup.py b/pytest-profiling/setup.py +index 612899a..fa412da 100644 +--- a/pytest-profiling/setup.py ++++ b/pytest-profiling/setup.py +@@ -22,9 +22,9 @@ install_requires = ['six', + 'gprof2dot', + ] + +-tests_require = [ +- 'pytest-virtualenv', +- ] ++extras_require = { ++ 'tests': ['pytest-virtualenv'] ++} + + entry_points = { + 'pytest11': [ +@@ -41,7 +41,7 @@ if __name__ == '__main__': + author_email='ed@catmur.co.uk', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_profiling'], + entry_points=entry_points, + )) +diff --git a/pytest-pyramid-server/setup.py b/pytest-pyramid-server/setup.py +index f6fbea0..a02587a 100644 +--- a/pytest-pyramid-server/setup.py ++++ b/pytest-pyramid-server/setup.py +@@ -26,9 +26,9 @@ install_requires = ['pytest-server-fixtures', + 'six', + ] + +-tests_require = [ +- 'pyramid-debugtoolbar', +- ] ++extras_require = { ++ 'tests': ['pyramid-debugtoolbar'] ++} + + entry_points = { + 'pytest11': [ +@@ -48,7 +48,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_pyramid_server', 'pyramid_server_test'], + entry_points=entry_points, + )) +diff --git a/pytest-qt-app/setup.py b/pytest-qt-app/setup.py +index 27f367a..3170aaf 100644 +--- a/pytest-qt-app/setup.py ++++ b/pytest-qt-app/setup.py +@@ -22,8 +22,9 @@ install_requires = ['pytest', + 'pytest-shutil', + ] + +-tests_require = ['pytest-cov' +- ] ++extras_require = { ++ 'tests': ['pytest-cov'] ++} + + entry_points = { + 'pytest11': [ +@@ -40,7 +41,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_qt_app'], + entry_points=entry_points, + )) +diff --git a/pytest-server-fixtures/setup.py b/pytest-server-fixtures/setup.py +index 065c1c2..88af64c 100644 +--- a/pytest-server-fixtures/setup.py ++++ b/pytest-server-fixtures/setup.py +@@ -36,13 +36,12 @@ extras_require = { + 's3': ["boto3"], + 'docker': ["docker"], + 'kubernetes': ["kubernetes"], ++ 'tests': [ ++ 'mock; python_version<"3.3"', ++ 'psutil', ++ ], + } + +-tests_require = [ +- 'mock; python_version<"3.3"', +- 'psutil', +- ] +- + entry_points = { + 'pytest11': [ + 'httpd_server = pytest_server_fixtures.httpd', +@@ -66,7 +65,6 @@ if __name__ == '__main__': + classifiers=classifiers, + install_requires=install_requires, + extras_require=extras_require, +- tests_require=tests_require, + packages=find_packages(exclude='tests'), + entry_points=entry_points, + )) +diff --git a/pytest-shutil/setup.py b/pytest-shutil/setup.py +index 43ed91e..e1d9e56 100644 +--- a/pytest-shutil/setup.py ++++ b/pytest-shutil/setup.py +@@ -27,8 +27,10 @@ install_requires = ['six', + 'termcolor' + ] + +-tests_require = ['pytest', +- ] ++ ++extras_require = { ++ 'tests': ["pytest"], ++} + + entry_points = { + 'pytest11': [ +@@ -45,7 +47,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + packages=find_packages(exclude='tests'), + entry_points=entry_points, + )) +diff --git a/pytest-svn/setup.py b/pytest-svn/setup.py +index 470181f..9d4d272 100644 +--- a/pytest-svn/setup.py ++++ b/pytest-svn/setup.py +@@ -21,9 +21,6 @@ install_requires = ['pytest', + 'pytest-shutil', + ] + +-tests_require = [ +- ] +- + entry_points = { + 'pytest11': [ + 'svn_repo = pytest_svn', +@@ -40,7 +37,6 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, + py_modules=['pytest_svn'], + entry_points=entry_points, + )) +diff --git a/pytest-verbose-parametrize/setup.py b/pytest-verbose-parametrize/setup.py +index ae0a482..b6fa5e1 100644 +--- a/pytest-verbose-parametrize/setup.py ++++ b/pytest-verbose-parametrize/setup.py +@@ -21,10 +21,11 @@ install_requires = ['pytest', + 'six', + ] + +-tests_require = ['mock; python_version<"3.3"', +- 'pytest-virtualenv', +- 'coverage', +- ] ++extras_require = { ++ 'tests': ['mock; python_version<"3.3"', ++ 'pytest-virtualenv', ++ 'coverage'] ++} + + entry_points = { + 'pytest11': [ +@@ -41,7 +42,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_verbose_parametrize'], + entry_points=entry_points, + )) +diff --git a/pytest-virtualenv/setup.py b/pytest-virtualenv/setup.py +index 815b59c..55f97e3 100644 +--- a/pytest-virtualenv/setup.py ++++ b/pytest-virtualenv/setup.py +@@ -25,9 +25,9 @@ install_requires = ['pytest-fixture-config', + 'importlib-metadata', + ] + +-tests_require = [ +- 'mock; python_version<"3.3"' +- ] ++extras_require = { ++ 'tests': ['mock; python_version<"3.3"'] ++} + + entry_points = { + 'pytest11': [ +@@ -44,7 +44,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_virtualenv'], + entry_points=entry_points, + )) +diff --git a/pytest-webdriver/setup.py b/pytest-webdriver/setup.py +index 280818a..afb618b 100644 +--- a/pytest-webdriver/setup.py ++++ b/pytest-webdriver/setup.py +@@ -23,8 +23,10 @@ install_requires = ['py', + 'selenium', + ] + +-tests_require = ['mock; python_version<"3.3"', +- ] ++ ++extras_require = { ++ 'tests': ['mock; python_version,"3.3"'], ++} + + entry_points = { + 'pytest11': [ +@@ -41,7 +43,7 @@ if __name__ == '__main__': + author_email='eeaston@gmail.com', + classifiers=classifiers, + install_requires=install_requires, +- tests_require=tests_require, ++ extras_require=extras_require, + py_modules=['pytest_webdriver'], + entry_points=entry_points, + )) diff --git a/pkgs/development/python-modules/pytest-server-fixtures/default.nix b/pkgs/development/python-modules/pytest-server-fixtures/default.nix index bc66d607c775..eddc3fc06fa9 100644 --- a/pkgs/development/python-modules/pytest-server-fixtures/default.nix +++ b/pkgs/development/python-modules/pytest-server-fixtures/default.nix @@ -12,12 +12,14 @@ setuptools, }: -buildPythonPackage rec { +buildPythonPackage { pname = "pytest-server-fixtures"; - inherit (pytest-fixture-config) version src; + inherit (pytest-fixture-config) version src patches; pyproject = true; - sourceRoot = "${src.name}/pytest-server-fixtures"; + postPatch = '' + cd pytest-server-fixtures + ''; build-system = [ setuptools ]; diff --git a/pkgs/development/python-modules/pytest-shutil/default.nix b/pkgs/development/python-modules/pytest-shutil/default.nix index 613b3e382d40..d8bde90932bf 100644 --- a/pkgs/development/python-modules/pytest-shutil/default.nix +++ b/pkgs/development/python-modules/pytest-shutil/default.nix @@ -21,22 +21,23 @@ pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage { pname = "pytest-shutil"; inherit (pytest-fixture-config) version src; pyproject = true; - sourceRoot = "${src.name}/pytest-shutil"; - # imp was removed in Python 3.12 patches = [ (fetchpatch { name = "stop-using-imp.patch"; url = "https://build.opensuse.org/public/source/openSUSE:Factory/python-pytest-shutil/stop-using-imp.patch?rev=10"; - hash = "sha256-L8tXoQ9q8o6aP3TpJY/sUVVbUd/ebw0h6de6dBj1WNY="; - stripLen = 1; + hash = "sha256-ZsfOic6VmKIlK+HeAlUwiM4fXgw9wHo445dP9j5/h8Q="; }) - ]; + ] ++ pytest-fixture-config.patches; + + postPatch = '' + cd pytest-shutil + ''; build-system = [ setuptools diff --git a/pkgs/development/python-modules/pytest-virtualenv/default.nix b/pkgs/development/python-modules/pytest-virtualenv/default.nix index fa276e748cdd..fc027dd93929 100644 --- a/pkgs/development/python-modules/pytest-virtualenv/default.nix +++ b/pkgs/development/python-modules/pytest-virtualenv/default.nix @@ -12,12 +12,14 @@ virtualenv, }: -buildPythonPackage rec { +buildPythonPackage { pname = "pytest-virtualenv"; - inherit (pytest-fixture-config) version src; + inherit (pytest-fixture-config) version src patches; pyproject = true; - sourceRoot = "${src.name}/pytest-virtualenv"; + postPatch = '' + cd pytest-virtualenv + ''; build-system = [ setuptools ]; From b1156644c8d663503ba0b0df276ce155eb755727 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 31 Jul 2024 22:13:48 +0200 Subject: [PATCH 11/43] python312Packages.pystray: run tests with pytest --- pkgs/development/python-modules/pystray/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pystray/default.nix b/pkgs/development/python-modules/pystray/default.nix index a448933fcc78..632356001c59 100644 --- a/pkgs/development/python-modules/pystray/default.nix +++ b/pkgs/development/python-modules/pystray/default.nix @@ -12,6 +12,7 @@ pygobject3, gtk3, libayatana-appindicator, + pytest, }: buildPythonPackage rec { @@ -54,12 +55,17 @@ buildPythonPackage rec { libayatana-appindicator ]; - nativeCheckInputs = [ xvfb-run ]; + nativeCheckInputs = [ + pytest + xvfb-run + ]; checkPhase = '' - rm tests/icon_tests.py # test needs user input + runHook preCheck - xvfb-run -s '-screen 0 800x600x24' python setup.py test + xvfb-run -s '-screen 0 800x600x24' pytest tests/menu_descriptor_tests.py + + runHook postCheck ''; meta = with lib; { From 7195f7421f50886002064f4656733693a20bb213 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 1 Aug 2024 05:39:46 +0200 Subject: [PATCH 12/43] python312Packages.myst-parser: disable failing tests --- pkgs/development/python-modules/myst-parser/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/myst-parser/default.nix b/pkgs/development/python-modules/myst-parser/default.nix index c5b7736c113a..c17dfe1510e0 100644 --- a/pkgs/development/python-modules/myst-parser/default.nix +++ b/pkgs/development/python-modules/myst-parser/default.nix @@ -55,6 +55,12 @@ buildPythonPackage rec { pytestCheckHook ] ++ markdown-it-py.optional-dependencies.linkify; + disabledTests = [ + # sphinx 7.4 compat + "test_gettext" + "test_gettext_additional_targets" + ]; + pythonImportsCheck = [ "myst_parser" ]; pythonRelaxDeps = [ "docutils" ]; From ccd56ee7c3c92ea0ca97c692153409600a8dd019 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 1 Aug 2024 05:42:16 +0200 Subject: [PATCH 13/43] python312Packages.pdm-backend: 2.3.1 -> 2.3.3 https://github.com/pdm-project/pdm-backend/releases/tag/2.3.2 https://github.com/pdm-project/pdm-backend/releases/tag/2.3.3 --- pkgs/development/python-modules/pdm-backend/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pdm-backend/default.nix b/pkgs/development/python-modules/pdm-backend/default.nix index 889c36936afc..64ad22dd1651 100644 --- a/pkgs/development/python-modules/pdm-backend/default.nix +++ b/pkgs/development/python-modules/pdm-backend/default.nix @@ -17,14 +17,14 @@ buildPythonPackage rec { pname = "pdm-backend"; - version = "2.3.1"; - format = "pyproject"; + version = "2.3.3"; + pyproject = true; src = fetchFromGitHub { owner = "pdm-project"; repo = "pdm-backend"; rev = "refs/tags/${version}"; - hash = "sha256-I1bAjryLDXzlstIHK4cD6/HPJBGGskRUVp7B2PDwXhc="; + hash = "sha256-gM8Sx6nMiq84e3sLJn35shF2jy6Ce1qPlERi2XpS89k="; }; env.PDM_BUILD_SCM_VERSION = version; From e47d0b5400d0e4c4aaf314db6cb833144bd1d11a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 2 Aug 2024 18:12:12 +0200 Subject: [PATCH 14/43] electrum-ltc: disable failing and stuck tests These tests have forced the hydra job for electrum-ltc to run into a timeout. --- pkgs/applications/misc/electrum/ltc.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/applications/misc/electrum/ltc.nix b/pkgs/applications/misc/electrum/ltc.nix index d74f706cbf92..110a17aeeac9 100644 --- a/pkgs/applications/misc/electrum/ltc.nix +++ b/pkgs/applications/misc/electrum/ltc.nix @@ -138,6 +138,11 @@ python3.pkgs.buildPythonApplication { disabledTests = [ "test_loop" # test tries to bind 127.0.0.1 causing permission error "test_is_ip_address" # fails spuriously https://github.com/spesmilo/electrum/issues/7307 + # electrum_ltc.lnutil.RemoteMisbehaving: received commitment_signed without pending changes + "test_reestablish_replay_messages_rev_then_sig" + "test_reestablish_replay_messages_sig_then_rev" + # stuck on hydra + "test_reestablish_with_old_state" ]; postCheck = '' From fddf1534d86f773604b2e178b0648b0894564723 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 2 Aug 2024 19:39:55 +0200 Subject: [PATCH 15/43] python312Packages.datasette: ignore deprecation warnings --- pkgs/development/python-modules/datasette/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/datasette/default.nix b/pkgs/development/python-modules/datasette/default.nix index fd31d3bbf189..29cf78eeed88 100644 --- a/pkgs/development/python-modules/datasette/default.nix +++ b/pkgs/development/python-modules/datasette/default.nix @@ -79,7 +79,12 @@ buildPythonPackage rec { # takes 30-180 mins to run entire test suite, not worth the CPU resources, slows down reviews # with pytest-xdist, it still takes around 10 mins with 32 cores # just run the csv tests, as this should give some indictation of correctness - pytestFlagsArray = [ "tests/test_csv.py" ]; + pytestFlagsArray = [ + # datasette/app.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html + "-W" + "ignore::DeprecationWarning" + "tests/test_csv.py" + ]; disabledTests = [ "facet" From cc2b171ac7f140cf562a42eabfe1794ce94f10ba Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 2 Aug 2024 19:48:06 +0200 Subject: [PATCH 16/43] python312Packages.python-daemon: fix build Accessing packaging via setuptools.extern is dead. --- .../python-modules/python-daemon/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/python-daemon/default.nix b/pkgs/development/python-modules/python-daemon/default.nix index 2adf0060dfb6..e8e8e2c018f7 100644 --- a/pkgs/development/python-modules/python-daemon/default.nix +++ b/pkgs/development/python-modules/python-daemon/default.nix @@ -4,17 +4,18 @@ fetchPypi, docutils, lockfile, + packaging, pytestCheckHook, testscenarios, testtools, - twine, + setuptools, pythonOlder, }: buildPythonPackage rec { pname = "python-daemon"; version = "3.0.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -23,7 +24,14 @@ buildPythonPackage rec { hash = "sha256-bFdFI3L36v9Ak0ocA60YJr9eeTVY6H/vSRMeZGS02uU="; }; - nativeBuildInputs = [ twine ]; + postPatch = '' + sed -i "s/setuptools\.extern\.//g" version.py test_version.py + ''; + + nativeBuildInputs = [ + setuptools + packaging + ]; propagatedBuildInputs = [ docutils From 1bf8aa36647488b87e4f7fd8d534f3480d540bc9 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 2 Aug 2024 22:08:25 +0200 Subject: [PATCH 17/43] python312Packages.liblarch: test with pytest --- pkgs/development/python-modules/liblarch/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/liblarch/default.nix b/pkgs/development/python-modules/liblarch/default.nix index 1f891c126aef..4dae337ca1f2 100644 --- a/pkgs/development/python-modules/liblarch/default.nix +++ b/pkgs/development/python-modules/liblarch/default.nix @@ -2,12 +2,12 @@ lib, fetchFromGitHub, buildPythonPackage, - python, pygobject3, xvfb-run, gobject-introspection, gtk3, pythonOlder, + pytest, }: buildPythonPackage rec { @@ -26,6 +26,7 @@ buildPythonPackage rec { nativeCheckInputs = [ gobject-introspection # for setup hook gtk3 + pytest ]; buildInputs = [ gtk3 ]; @@ -34,8 +35,7 @@ buildPythonPackage rec { checkPhase = '' runHook preCheck - ${xvfb-run}/bin/xvfb-run -s '-screen 0 800x600x24' \ - ${python.interpreter} nix_run_setup test + ${xvfb-run}/bin/xvfb-run -s '-screen 0 800x600x24' pytest runHook postCheck ''; From 0ab55a6ce8ba2b7bca3a4fd22c08c3b252bc6bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 31 Jul 2024 06:18:55 -0700 Subject: [PATCH 18/43] python312Packages.aiohttp: 3.9.5 -> 3.10.0 Diff: https://github.com/aio-libs/aiohttp/compare/refs/tags/v3.9.5...v3.10.0 Changelog: https://github.com/aio-libs/aiohttp/blob/v3.10.0/CHANGES.rst --- .../python-modules/aiohttp/default.nix | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix index 20d911edfbba..b0682cec1be7 100644 --- a/pkgs/development/python-modules/aiohttp/default.nix +++ b/pkgs/development/python-modules/aiohttp/default.nix @@ -11,6 +11,7 @@ cython, setuptools, # install_requires + aiohappyeyeballs, attrs, multidict, async-timeout, @@ -22,6 +23,7 @@ # tests_require freezegun, gunicorn, + proxy-py, pytest-mock, pytest7CheckHook, python-on-whales, @@ -31,7 +33,7 @@ buildPythonPackage rec { pname = "aiohttp"; - version = "3.9.5"; + version = "3.10.0"; pyproject = true; disabled = pythonOlder "3.8"; @@ -40,7 +42,7 @@ buildPythonPackage rec { owner = "aio-libs"; repo = "aiohttp"; rev = "refs/tags/v${version}"; - hash = "sha256-FRtirmwgU8v+ee3db7rOFsmy0rNW8A7+yRZC5d6uYNA="; + hash = "sha256-8B5WyG3XUAxjoY08PTbkNM11K/ytlvdplhf2VV+I+JU="; }; patches = [ @@ -69,6 +71,7 @@ buildPythonPackage rec { ''; dependencies = [ + aiohappyeyeballs attrs multidict async-timeout @@ -85,20 +88,16 @@ buildPythonPackage rec { ''; # NOTE: pytest-xdist cannot be added because it is flaky. See https://github.com/NixOS/nixpkgs/issues/230597 for more info. - nativeCheckInputs = - [ - freezegun - gunicorn - pytest-mock - pytest7CheckHook - python-on-whales - re-assert - ] - ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [ - # Optional test dependency. Depends indirectly on pyopenssl, which is - # broken on aarch64-darwin. - trustme - ]; + nativeCheckInputs = [ + freezegun + gunicorn + proxy-py + pytest-mock + pytest7CheckHook + python-on-whales + re-assert + trustme + ]; disabledTests = [ @@ -115,17 +114,15 @@ buildPythonPackage rec { "test_close" ]; - disabledTestPaths = [ - "tests/test_proxy_functional.py" # FIXME package proxy.py - ]; - __darwinAllowLocalNetworking = true; - # aiohttp in current folder shadows installed version preCheck = '' + # aiohttp in current folder shadows installed version rm -r aiohttp touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990 + + export HOME=$(mktemp -d) '' + lib.optionalString stdenv.isDarwin '' # Work around "OSError: AF_UNIX path too long" From b9a16acbae51e84898f34cbc8a6ff9c4867861d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 31 Jul 2024 06:39:49 -0700 Subject: [PATCH 19/43] python312Packages.uvloop: don't run aiohttp tests Depending on aiohttp yields an infinite recursion. --- pkgs/development/python-modules/uvloop/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/uvloop/default.nix b/pkgs/development/python-modules/uvloop/default.nix index 905a923dc7bf..9d3240bdf3dd 100644 --- a/pkgs/development/python-modules/uvloop/default.nix +++ b/pkgs/development/python-modules/uvloop/default.nix @@ -15,7 +15,6 @@ ApplicationServices, # tests - aiohttp, psutil, pyopenssl, pytestCheckHook, @@ -48,7 +47,6 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - aiohttp pyopenssl pytestCheckHook psutil From 1957bde1fb62c161a0382d02d4480f5de8de9c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 31 Jul 2024 07:17:35 -0700 Subject: [PATCH 20/43] python312Packages.aiohappyeyeballs: enable previously broken test --- pkgs/development/python-modules/aiohappyeyeballs/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/development/python-modules/aiohappyeyeballs/default.nix b/pkgs/development/python-modules/aiohappyeyeballs/default.nix index 550d1d69133e..7a778be238be 100644 --- a/pkgs/development/python-modules/aiohappyeyeballs/default.nix +++ b/pkgs/development/python-modules/aiohappyeyeballs/default.nix @@ -60,11 +60,6 @@ buildPythonPackage rec { pythonImportsCheck = [ "aiohappyeyeballs" ]; - disabledTestPaths = [ - # https://github.com/bdraco/aiohappyeyeballs/issues/30 - "tests/test_impl.py" - ]; - meta = with lib; { description = "Happy Eyeballs for pre-resolved hosts"; homepage = "https://github.com/bdraco/aiohappyeyeballs"; From 6bd87a30bfcf9435de577f15c200e656aac05366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 31 Jul 2024 07:43:09 -0700 Subject: [PATCH 21/43] python312Packages.aiohttp-fast-url-dispatcher: unpin aiohttp --- .../python-modules/aiohttp-fast-url-dispatcher/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix b/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix index 8e4cd760a5f7..e65e3fea31d7 100644 --- a/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix +++ b/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix @@ -30,6 +30,8 @@ buildPythonPackage rec { nativeBuildInputs = [ poetry-core ]; + pythonRelaxDeps = [ "aiohttp" ]; + propagatedBuildInputs = [ aiohttp ]; nativeCheckInputs = [ From 45fd62a5392f87a7b7b98a2955315456ea323e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 31 Jul 2024 07:43:53 -0700 Subject: [PATCH 22/43] python312Packages.aiohttp-fast-url-dispatcher: 0.3.0 -> 0.3.1 Diff: https://github.com/bdraco/aiohttp-fast-url-dispatcher/compare/refs/tags/v0.3.0...v0.3.1 Changelog: https://github.com/bdraco/aiohttp-fast-url-dispatcher/blob/v0.3.1/CHANGELOG.md --- .../python-modules/aiohttp-fast-url-dispatcher/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix b/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix index e65e3fea31d7..60cf4e1ee4e8 100644 --- a/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix +++ b/pkgs/development/python-modules/aiohttp-fast-url-dispatcher/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "aiohttp-fast-url-dispatcher"; - version = "0.3.0"; + version = "0.3.1"; pyproject = true; disabled = pythonOlder "3.8"; @@ -20,7 +20,7 @@ buildPythonPackage rec { owner = "bdraco"; repo = "aiohttp-fast-url-dispatcher"; rev = "refs/tags/v${version}"; - hash = "sha256-DZTW9CazcUY3hyxr0MbVfM/yJzUzwN43c2n07Sloxa8="; + hash = "sha256-RBS17LhbaAOxFYGjmoEyrq2DCEHeZNpkITPDdCd7Jk0="; }; postPatch = '' @@ -44,7 +44,7 @@ buildPythonPackage rec { meta = with lib; { description = "Faster URL dispatcher for aiohttp"; homepage = "https://github.com/bdraco/aiohttp-fast-url-dispatcher"; - changelog = "https://github.com/bdraco/aiohttp-fast-url-dispatcher/blob/${version}/CHANGELOG.md"; + changelog = "https://github.com/bdraco/aiohttp-fast-url-dispatcher/blob/${src.rev}/CHANGELOG.md"; license = licenses.asl20; maintainers = with maintainers; [ fab ]; }; From 9cce6b2c487fbd25ac90411fd4bda3d12d8f70d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 31 Jul 2024 07:52:44 -0700 Subject: [PATCH 23/43] python312Packages.async-upnp-client: 0.39.0 -> 0.40.0 Diff: https://github.com/StevenLooman/async_upnp_client/compare/refs/tags/0.39.0...0.40.0 Changelog: https://github.com/StevenLooman/async_upnp_client/blob/0.40.0/CHANGES.rst --- pkgs/development/python-modules/async-upnp-client/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/async-upnp-client/default.nix b/pkgs/development/python-modules/async-upnp-client/default.nix index 7c87735f7472..18969f48233d 100644 --- a/pkgs/development/python-modules/async-upnp-client/default.nix +++ b/pkgs/development/python-modules/async-upnp-client/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { pname = "async-upnp-client"; - version = "0.39.0"; + version = "0.40.0"; pyproject = true; disabled = pythonOlder "3.8"; @@ -32,7 +32,7 @@ buildPythonPackage rec { owner = "StevenLooman"; repo = "async_upnp_client"; rev = "refs/tags/${version}"; - hash = "sha256-2A46/j6DkZ7rz/B64aBAp0NvRG5TBuL4VwMVS50+fQs="; + hash = "sha256-KaX1TNP6IP2wAijR2y9cqI+Pyc+Ygk3LqKwu5Yrv5LM="; }; pythonRelaxDeps = [ "defusedxml" ]; From 7983e66e0e8fbdaffd4b5ee07746d0301988ac53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 1 Aug 2024 07:58:17 -0700 Subject: [PATCH 24/43] python312Packages.mocket: disable test failing due to DNS lookup --- pkgs/development/python-modules/mocket/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/mocket/default.nix b/pkgs/development/python-modules/mocket/default.nix index 323633d3a439..eb5ffb2b244f 100644 --- a/pkgs/development/python-modules/mocket/default.nix +++ b/pkgs/development/python-modules/mocket/default.nix @@ -91,6 +91,7 @@ buildPythonPackage rec { disabledTests = [ # tests that require network access (like DNS lookups) "test_truesendall_with_dump_from_recording" + "test_aiohttp" "test_asyncio_record_replay" "test_gethostbyname" # httpx read failure From c8dd37a2a79659a3d6d7890133d1f982d3bedc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 29 Jul 2024 12:05:11 -0700 Subject: [PATCH 25/43] python312Packages.atpublic: 4.1.0 -> 5.0 Diff: https://gitlab.com/warsaw/public/-/compare/refs/tags/4.1.0...5.0 Changelog: https://gitlab.com/warsaw/public/-/blob/5.0/docs/NEWS.rst --- .../python-modules/atpublic/default.nix | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/atpublic/default.nix b/pkgs/development/python-modules/atpublic/default.nix index cf752f0a59c5..9789b8c47122 100644 --- a/pkgs/development/python-modules/atpublic/default.nix +++ b/pkgs/development/python-modules/atpublic/default.nix @@ -1,47 +1,38 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitLab, pytestCheckHook, pythonOlder, hatchling, sybil, - typing-extensions, }: buildPythonPackage rec { pname = "atpublic"; - version = "4.1.0"; - format = "pyproject"; + version = "5.0"; + pyproject = true; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-0cjNkxr3Rh9tGLxgYzg+hlTZ6e8Z1Y7m3AHoUVu/Vd8="; + src = fetchFromGitLab { + owner = "warsaw"; + repo = "public"; + rev = "refs/tags/${version}"; + hash = "sha256-cqum+4hREu0jO9iFoUUzfzn597BoMAhG+aanwnh8hb8="; }; - nativeBuildInputs = [ hatchling ]; - - propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + build-system = [ hatchling ]; nativeCheckInputs = [ pytestCheckHook sybil ]; - pytestFlagsArray = [ - # TypeError: FixtureManager.getfixtureclosure() missing 1 required positional argument: 'ignore_args' - "--ignore=docs/using.rst" - ]; - - postPatch = '' - sed -i '/cov=public/d' pyproject.toml - ''; - pythonImportsCheck = [ "public" ]; meta = with lib; { + changelog = "https://gitlab.com/warsaw/public/-/blob/${version}/docs/NEWS.rst"; description = "Python decorator and function which populates a module's __all__ and globals"; homepage = "https://public.readthedocs.io/"; longDescription = '' From c3dacd86f095e325888d6dc91b1beef5bc5eafe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 23 Jul 2024 08:47:00 -0700 Subject: [PATCH 26/43] python312Packages.anyio: 4.3.0 -> 4.4.0 Diff: https://github.com/agronholm/anyio/compare/refs/tags/4.3.0...4.4.0 Changelog: https://github.com/agronholm/anyio/blob/refs/tags/4.4.0/docs/versionhistory.rst --- .../python-modules/anyio/default.nix | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/anyio/default.nix b/pkgs/development/python-modules/anyio/default.nix index 3c1492c98223..296fbcdc3563 100644 --- a/pkgs/development/python-modules/anyio/default.nix +++ b/pkgs/development/python-modules/anyio/default.nix @@ -6,7 +6,6 @@ pythonOlder, # build-system - setuptools, setuptools-scm, # dependencies @@ -33,24 +32,21 @@ buildPythonPackage rec { pname = "anyio"; - version = "4.3.0"; + version = "4.4.0"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "agronholm"; - repo = pname; + repo = "anyio"; rev = "refs/tags/${version}"; - hash = "sha256-y58DQiTD0ZKaBNf0cA3MFE+7F68Svrl+Idz6BZY7HWQ="; + hash = "sha256-Sz/wWOT59T7LOAq68fBujgkTaY9ydMsIoSxeP3fBaoY="; }; - nativeBuildInputs = [ - setuptools - setuptools-scm - ]; + build-system = [ setuptools-scm ]; - propagatedBuildInputs = + dependencies = [ idna sniffio @@ -64,9 +60,6 @@ buildPythonPackage rec { trio = [ trio ]; }; - # trustme uses pyopenssl - doCheck = !(stdenv.isDarwin && stdenv.isAarch64); - nativeCheckInputs = [ exceptiongroup hypothesis @@ -85,7 +78,7 @@ buildPythonPackage rec { "'not network'" ]; - disabledTests = lib.optionals (stdenv.isx86_64 && stdenv.isDarwin) [ + disabledTests = lib.optionals stdenv.isDarwin [ # PermissionError: [Errno 1] Operation not permitted: '/dev/console' "test_is_block_device" ]; From 003b09912e7f931133afeede3544729fccb9a513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 23 Jul 2024 10:29:54 -0700 Subject: [PATCH 27/43] python312Packages.starlette: fix tests --- pkgs/development/python-modules/starlette/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/starlette/default.nix b/pkgs/development/python-modules/starlette/default.nix index 73fb920314c9..21551a5786da 100644 --- a/pkgs/development/python-modules/starlette/default.nix +++ b/pkgs/development/python-modules/starlette/default.nix @@ -63,6 +63,8 @@ buildPythonPackage rec { "ignore::DeprecationWarning" "-W" "ignore::trio.TrioDeprecationWarning" + "-W" + "ignore::ResourceWarning" # FIXME remove once test suite is fully compatible with anyio 4.4.0 ]; pythonImportsCheck = [ "starlette" ]; From da270cd5759771ced8331f7a3b48d2d36e93145b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 30 Jul 2024 07:27:49 -0700 Subject: [PATCH 28/43] python312Packages.av: 12.2.0 -> 12.3.0 Diff: https://github.com/mikeboers/PyAV/compare/refs/tags/v12.2.0...v12.3.0 Changelog: https://github.com/PyAV-Org/PyAV/blob/v12.3.0/CHANGELOG.rst --- pkgs/development/python-modules/av/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/av/default.nix b/pkgs/development/python-modules/av/default.nix index e50028415d8a..57fca04c0a4b 100644 --- a/pkgs/development/python-modules/av/default.nix +++ b/pkgs/development/python-modules/av/default.nix @@ -17,24 +17,25 @@ buildPythonPackage rec { pname = "av"; - version = "12.2.0"; + version = "12.3.0"; pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = "mikeboers"; + owner = "PyAV-Org"; repo = "PyAV"; rev = "refs/tags/v${version}"; - hash = "sha256-yPVAtL71pL/ok3bli+r/IruCrmmhNyv98pr7z3m8sbo="; + hash = "sha256-ezeYv55UzNnnYDjrMz5YS5g2pV6U/Fxx3e2bCoPP3eI="; }; - nativeBuildInputs = [ + build-system = [ cython - pkg-config setuptools ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ ffmpeg_6-headless ]; preCheck = @@ -95,7 +96,7 @@ buildPythonPackage rec { meta = with lib; { description = "Pythonic bindings for FFmpeg/Libav"; mainProgram = "pyav"; - homepage = "https://github.com/mikeboers/PyAV/"; + homepage = "https://github.com/PyAV-Org/PyAV"; changelog = "https://github.com/PyAV-Org/PyAV/blob/v${version}/CHANGELOG.rst"; license = licenses.bsd2; maintainers = [ ]; From e340c59f5eb3983e44a6a7aeed148ce80e3e1f25 Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 4 Jul 2024 15:52:11 +0900 Subject: [PATCH 29/43] python311Packages.python-ulid: 2.2.0 -> 2.7.0 Diff: https://github.com/mdomke/python-ulid/compare/refs/tags/2.2.0...2.7.0 Changelog: https://github.com/mdomke/python-ulid/blob/refs/tags/2.7.0/CHANGELOG.rst --- .../python-modules/python-ulid/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/python-ulid/default.nix b/pkgs/development/python-modules/python-ulid/default.nix index 59c07c6453c8..9dc439fde706 100644 --- a/pkgs/development/python-modules/python-ulid/default.nix +++ b/pkgs/development/python-modules/python-ulid/default.nix @@ -6,13 +6,14 @@ hatch-fancy-pypi-readme, hatch-vcs, hatchling, + pydantic, freezegun, pytestCheckHook, }: buildPythonPackage rec { pname = "python-ulid"; - version = "2.2.0"; + version = "2.7.0"; pyproject = true; disabled = pythonOlder "3.9"; @@ -21,19 +22,23 @@ buildPythonPackage rec { owner = "mdomke"; repo = "python-ulid"; rev = "refs/tags/${version}"; - hash = "sha256-d5jCPxWUOfw/OCtbA9Db9+s1D5DAdL+vbPR8zavgbbo="; + hash = "sha256-Z9rYqekhrYa8ab17AVmKyObvq4HTOij7+LMlvRSqUQM="; }; - nativeBuildInputs = [ + build-system = [ hatch-fancy-pypi-readme hatch-vcs hatchling ]; + optional-dependencies = { + pydantic = [ pydantic ]; + }; + nativeCheckInputs = [ freezegun pytestCheckHook - ]; + ] ++ optional-dependencies.pydantic; pythonImportsCheck = [ "ulid" ]; From 633d642f4672e0c9451e761c32263d6ea6699fc0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 23 Jul 2024 16:51:04 +0200 Subject: [PATCH 30/43] python312Packages.requests: fix ca loading regression in 2.32.3 Requests in 2.32.3 caused a regression in the code path that loads the default certificate authorities, breaking downstream consumers like httpie in the process. The patch series fixing this is currently still a draft, since tests are missing, but it at least fixes the reproducer and httpie. --- .../requests/ca-load-regression.patch | 126 ++++++++++++++++++ .../python-modules/requests/default.nix | 6 + 2 files changed, 132 insertions(+) create mode 100644 pkgs/development/python-modules/requests/ca-load-regression.patch diff --git a/pkgs/development/python-modules/requests/ca-load-regression.patch b/pkgs/development/python-modules/requests/ca-load-regression.patch new file mode 100644 index 000000000000..e20d213cd23a --- /dev/null +++ b/pkgs/development/python-modules/requests/ca-load-regression.patch @@ -0,0 +1,126 @@ +From 2769cb607d4e696e2fe70802d4246ccc5abd64a8 Mon Sep 17 00:00:00 2001 +From: Nate Prewitt +Date: Wed, 29 May 2024 12:48:48 -0700 +Subject: [PATCH 1/3] Consider cert settings when using default context + +--- + src/requests/adapters.py | 26 ++++++++++++++++++-------- + 1 file changed, 18 insertions(+), 8 deletions(-) + +diff --git a/src/requests/adapters.py b/src/requests/adapters.py +index 9a58b16025..991b7e21c9 100644 +--- a/src/requests/adapters.py ++++ b/src/requests/adapters.py +@@ -87,6 +87,23 @@ def SOCKSProxyManager(*args, **kwargs): + _preloaded_ssl_context = None + + ++def _should_use_default_context( ++ verify: "bool | str | None", ++ client_cert: "typing.Tuple[str, str] | str | None", ++ poolmanager_kwargs: typing.Dict[str, typing.Any], ++) -> bool: ++ # Determine if we have and should use our default SSLContext ++ # to optimize performance on standard requests. ++ has_poolmanager_ssl_context = poolmanager_kwargs.get("ssl_context") ++ should_use_default_ssl_context = ( ++ verify is True ++ and _preloaded_ssl_context is not None ++ and not has_poolmanager_ssl_context ++ and client_cert is None ++ ) ++ return should_use_default_ssl_context ++ ++ + def _urllib3_request_context( + request: "PreparedRequest", + verify: "bool | str | None", +@@ -98,19 +115,12 @@ def _urllib3_request_context( + parsed_request_url = urlparse(request.url) + scheme = parsed_request_url.scheme.lower() + port = parsed_request_url.port +- +- # Determine if we have and should use our default SSLContext +- # to optimize performance on standard requests. + poolmanager_kwargs = getattr(poolmanager, "connection_pool_kw", {}) +- has_poolmanager_ssl_context = poolmanager_kwargs.get("ssl_context") +- should_use_default_ssl_context = ( +- _preloaded_ssl_context is not None and not has_poolmanager_ssl_context +- ) + + cert_reqs = "CERT_REQUIRED" + if verify is False: + cert_reqs = "CERT_NONE" +- elif verify is True and should_use_default_ssl_context: ++ elif _should_use_default_context(verify, client_cert, poolmanager_kwargs): + pool_kwargs["ssl_context"] = _preloaded_ssl_context + elif isinstance(verify, str): + if not os.path.isdir(verify): + +From e341df3efa0323072fab5d16307e2a20295675b9 Mon Sep 17 00:00:00 2001 +From: Nate Prewitt +Date: Fri, 31 May 2024 11:41:48 -0700 +Subject: [PATCH 2/3] Set default ca_cert bundle if verify is True + +--- + src/requests/adapters.py | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/src/requests/adapters.py b/src/requests/adapters.py +index 991b7e21c9..ba5a0ec4f0 100644 +--- a/src/requests/adapters.py ++++ b/src/requests/adapters.py +@@ -118,15 +118,23 @@ def _urllib3_request_context( + poolmanager_kwargs = getattr(poolmanager, "connection_pool_kw", {}) + + cert_reqs = "CERT_REQUIRED" ++ cert_loc = None + if verify is False: + cert_reqs = "CERT_NONE" + elif _should_use_default_context(verify, client_cert, poolmanager_kwargs): + pool_kwargs["ssl_context"] = _preloaded_ssl_context ++ elif verify is True: ++ # Set default ca cert location if none provided ++ cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) + elif isinstance(verify, str): +- if not os.path.isdir(verify): +- pool_kwargs["ca_certs"] = verify ++ cert_loc = verify ++ ++ if cert_loc is not None: ++ if not os.path.isdir(cert_loc): ++ pool_kwargs["ca_certs"] = cert_loc + else: +- pool_kwargs["ca_cert_dir"] = verify ++ pool_kwargs["ca_cert_dir"] = cert_loc ++ + pool_kwargs["cert_reqs"] = cert_reqs + if client_cert is not None: + if isinstance(client_cert, tuple) and len(client_cert) == 2: + +From da96a92e2eb6dfe7c74704267bcb8f9fd6fb92b0 Mon Sep 17 00:00:00 2001 +From: Nate Prewitt +Date: Fri, 31 May 2024 12:20:11 -0700 +Subject: [PATCH 3/3] Correct comment to match actual behavior + +--- + src/requests/adapters.py | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/requests/adapters.py b/src/requests/adapters.py +index ba5a0ec4f0..54143f9e6b 100644 +--- a/src/requests/adapters.py ++++ b/src/requests/adapters.py +@@ -334,10 +334,8 @@ def cert_verify(self, conn, url, verify, cert): + if url.lower().startswith("https") and verify: + conn.cert_reqs = "CERT_REQUIRED" + +- # Only load the CA certificates if 'verify' is a string indicating the CA bundle to use. +- # Otherwise, if verify is a boolean, we don't load anything since +- # the connection will be using a context with the default certificates already loaded, +- # and this avoids a call to the slow load_verify_locations() ++ # Only load the CA certificates if `verify` is a ++ # string indicating the CA bundle to use. + if verify is not True: + # `verify` must be a str with a path then + cert_loc = verify diff --git a/pkgs/development/python-modules/requests/default.nix b/pkgs/development/python-modules/requests/default.nix index a483d0069518..c8ec3c490ecf 100644 --- a/pkgs/development/python-modules/requests/default.nix +++ b/pkgs/development/python-modules/requests/default.nix @@ -30,6 +30,12 @@ buildPythonPackage rec { hash = "sha256-VTZUF3NOsYJVWQqf+euX6eHaho1MzWQCOZ6vaK8gp2A="; }; + patches = [ + # https://github.com/psf/requests/issues/6730 + # https://github.com/psf/requests/pull/6731 + ./ca-load-regression.patch + ]; + dependencies = [ brotlicffi certifi From 717e520fa0778701162c68add4969d7c0efdbe56 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 3 Aug 2024 03:46:56 +0200 Subject: [PATCH 31/43] python312Packages.pytest: 8.2.2 -> 8.3.2 https://github.com/pytest-dev/pytest/releases/tag/8.3.0 https://github.com/pytest-dev/pytest/releases/tag/8.3.1 https://github.com/pytest-dev/pytest/releases/tag/8.3.2 --- .../8.2.2-unittest-testcase-regression.patch | 72 ------------------- .../python-modules/pytest/default.nix | 10 +-- 2 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 pkgs/development/python-modules/pytest/8.2.2-unittest-testcase-regression.patch diff --git a/pkgs/development/python-modules/pytest/8.2.2-unittest-testcase-regression.patch b/pkgs/development/python-modules/pytest/8.2.2-unittest-testcase-regression.patch deleted file mode 100644 index 1d127b191f81..000000000000 --- a/pkgs/development/python-modules/pytest/8.2.2-unittest-testcase-regression.patch +++ /dev/null @@ -1,72 +0,0 @@ -From de47b73520fd9b7e41272701d7fd4663357af046 Mon Sep 17 00:00:00 2001 -From: Ran Benita -Date: Fri, 7 Jun 2024 09:49:29 +0300 -Subject: [PATCH] unittest: fix assertion errors on unittest reruns - -This fixes unittest test reruns when using plugins like -pytest-rerunfailures. - -The `instance` property uses AttributeError to check if the instance -needs to be initialized, so `del` is the correct way to clear it, not -setting to `None`. - -Regressed in 8.2.2. ---- - changelog/12424.bugfix.rst | 1 + - src/_pytest/unittest.py | 2 +- - .../pytest_rerunfailures_integration.py | 11 +++++++++++ - tox.ini | 2 +- - 4 files changed, 14 insertions(+), 2 deletions(-) - create mode 100644 changelog/12424.bugfix.rst - create mode 100644 testing/plugins_integration/pytest_rerunfailures_integration.py - -diff --git a/changelog/12424.bugfix.rst b/changelog/12424.bugfix.rst -new file mode 100644 -index 00000000000..7ad1126858b ---- /dev/null -+++ b/changelog/12424.bugfix.rst -@@ -0,0 +1 @@ -+Fix crash with `assert testcase is not None` assertion failure when re-running unittest tests using plugins like pytest-rerunfailures. Regressed in 8.2.2. -diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py -index 643443f08c6..ca82ac5c14a 100644 ---- a/src/_pytest/unittest.py -+++ b/src/_pytest/unittest.py -@@ -222,7 +222,7 @@ def teardown(self) -> None: - self._explicit_tearDown() - self._explicit_tearDown = None - self._obj = None -- self._instance = None -+ del self._instance - super().teardown() - - def startTest(self, testcase: "unittest.TestCase") -> None: -diff --git a/testing/plugins_integration/pytest_rerunfailures_integration.py b/testing/plugins_integration/pytest_rerunfailures_integration.py -new file mode 100644 -index 00000000000..9a13a3279a9 ---- /dev/null -+++ b/testing/plugins_integration/pytest_rerunfailures_integration.py -@@ -0,0 +1,11 @@ -+import unittest -+ -+ -+class MyTestCase(unittest.TestCase): -+ first_time = True -+ -+ def test_fail_the_first_time(self) -> None: -+ """Regression test for issue #12424.""" -+ if self.first_time: -+ type(self).first_time = False -+ self.fail() -diff --git a/tox.ini b/tox.ini -index 0a3f0acf5b8..35b335a015d 100644 ---- a/tox.ini -+++ b/tox.ini -@@ -141,7 +141,7 @@ commands = - pytest --cov=. simple_integration.py - pytest --ds=django_settings simple_integration.py - pytest --html=simple.html simple_integration.py -- pytest --reruns 5 simple_integration.py -+ pytest --reruns 5 simple_integration.py pytest_rerunfailures_integration.py - pytest pytest_anyio_integration.py - pytest pytest_asyncio_integration.py - pytest pytest_mock_integration.py diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index 38675d502277..fc5ca9c2a37b 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -29,20 +29,14 @@ buildPythonPackage rec { pname = "pytest"; - version = "8.2.2"; + version = "8.3.2"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-3ku4EE4gGTnM3GiLJ6iae+IHmyLivSsH+Aa2unEReXc="; + hash = "sha256-wTI0XRLOVRJCyHJp3oEkg/W8yHzbtHIuSEh7oZT5/c4="; }; - patches = [ - # https://github.com/pytest-dev/pytest/issues/12424 - # https://github.com/pytest-dev/pytest/pull/12436 - ./8.2.2-unittest-testcase-regression.patch - ]; - outputs = [ "out" "testout" From 287943d6ddc23a04118bfb778475eeccf061cbcc Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 3 Aug 2024 04:22:16 +0200 Subject: [PATCH 32/43] python312Packages.hypothesis: 6.103.0 -> 6.108.5 https://hypothesis.readthedocs.io/en/latest/changes.html#v6-108-5 --- pkgs/development/python-modules/hypothesis/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hypothesis/default.nix b/pkgs/development/python-modules/hypothesis/default.nix index 9590857b3480..4379303f3dba 100644 --- a/pkgs/development/python-modules/hypothesis/default.nix +++ b/pkgs/development/python-modules/hypothesis/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { pname = "hypothesis"; - version = "6.103.0"; + version = "6.108.5"; pyproject = true; disabled = pythonOlder "3.7"; @@ -32,7 +32,7 @@ buildPythonPackage rec { owner = "HypothesisWorks"; repo = "hypothesis"; rev = "hypothesis-python-${version}"; - hash = "sha256-sll0GAI1nvBQvRqgpTkLpj7GQI988AftDQHV1zh2t1w="; + hash = "sha256-APZTI7AxbtLT+2mkxUapr1sPcq4ViMXy1J6g0I30s5A="; }; # I tried to package sphinx-selective-exclude, but it throws From 26414d70afde6fa0c7443b7f9c0641b47f21a9ae Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 3 Aug 2024 07:51:50 +0200 Subject: [PATCH 33/43] python312Packages.pillow: 10.3.0 -> 10.4.0 --- pkgs/development/python-modules/pillow/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix index 87e982491fe8..b5257f5101d2 100644 --- a/pkgs/development/python-modules/pillow/default.nix +++ b/pkgs/development/python-modules/pillow/default.nix @@ -35,7 +35,7 @@ import ./generic.nix ( rec { pname = "pillow"; - version = "10.3.0"; + version = "10.4.0"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -43,7 +43,7 @@ import ./generic.nix ( src = fetchPypi { pname = "pillow"; inherit version; - hash = "sha256-nSRV+/RMkUhAx5PomqgtDhdjoUJToAB0NxmuWUaBSy0="; + hash = "sha256-Fmwc1NJDCbMNYfefSpEUt7IxPXRQkSJ3hV/139fNSgY="; }; passthru.tests = { From 3c26a3a495680ffa496b836ed9f0baf884782565 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 3 Aug 2024 23:12:40 +0200 Subject: [PATCH 34/43] python312Packages.fastapi: 0.111.0 -> 0.112.0 https://github.com/tiangolo/fastapi/releases/tag/0.112.0 --- .../python-modules/fastapi/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/fastapi/default.nix b/pkgs/development/python-modules/fastapi/default.nix index 83f0eb95438a..f4e5b5cb513f 100644 --- a/pkgs/development/python-modules/fastapi/default.nix +++ b/pkgs/development/python-modules/fastapi/default.nix @@ -17,9 +17,9 @@ dirty-equals, flask, passlib, + pyjwt, pytest-asyncio, pytestCheckHook, - python-jose, sqlalchemy, trio, @@ -39,7 +39,7 @@ buildPythonPackage rec { pname = "fastapi"; - version = "0.111.0"; + version = "0.112.0"; pyproject = true; disabled = pythonOlder "3.7"; @@ -48,7 +48,7 @@ buildPythonPackage rec { owner = "tiangolo"; repo = "fastapi"; rev = "refs/tags/${version}"; - hash = "sha256-DQYjK1dZuL7cF6quyNkgdd/GYmWm7k6YlF7YEjObQlI="; + hash = "sha256-M09yte0BGC5w3AZSwDUr9qKUrotqVklO8mwyms9B95Y="; }; build-system = [ pdm-backend ]; @@ -87,17 +87,23 @@ buildPythonPackage rec { dirty-equals flask passlib + pyjwt pytestCheckHook pytest-asyncio - python-jose trio sqlalchemy - ] ++ optional-dependencies.all ++ python-jose.optional-dependencies.cryptography; + ] ++ optional-dependencies.all; pytestFlagsArray = [ # ignoring deprecation warnings to avoid test failure from # tests/test_tutorial/test_testing/test_tutorial001.py "-W ignore::DeprecationWarning" + "-W ignore::pytest.PytestUnraisableExceptionWarning" + ]; + + disabledTests = [ + # Coverage test + "test_fastapi_cli" ]; disabledTestPaths = [ From 96c7496c70637cc943b16c5ae9d2e9ecc68aa2f0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Aug 2024 00:23:13 +0200 Subject: [PATCH 35/43] python312Packages.httpretty: fix build --- .../python-modules/httpretty/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/httpretty/default.nix b/pkgs/development/python-modules/httpretty/default.nix index ea38f414e32a..0eb948bea474 100644 --- a/pkgs/development/python-modules/httpretty/default.nix +++ b/pkgs/development/python-modules/httpretty/default.nix @@ -2,32 +2,32 @@ lib, buildPythonPackage, fetchPypi, - sure, - six, + setuptools, + + # tests freezegun, + mock, pytestCheckHook, + sure, }: buildPythonPackage rec { pname = "httpretty"; version = "1.1.4"; - format = "setuptools"; - - # drop this for version > 0.9.7 - # Flaky tests: https://github.com/gabrielfalcao/HTTPretty/pull/394 - doCheck = lib.versionAtLeast version "0.9.8"; + pyproject = true; src = fetchPypi { inherit pname version; sha256 = "20de0e5dd5a18292d36d928cc3d6e52f8b2ac73daec40d41eb62dee154933b68"; }; - propagatedBuildInputs = [ six ]; + build-system = [ setuptools ]; nativeCheckInputs = [ - sure freezegun + mock pytestCheckHook + sure ]; disabledTestPaths = [ From 2ebc3e29129965f272dd5cad789783646bbc0b2a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Aug 2024 00:24:01 +0200 Subject: [PATCH 36/43] python312Packages.sure: propagate mock Used but undeclared runtime dependency. --- pkgs/development/python-modules/sure/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/sure/default.nix b/pkgs/development/python-modules/sure/default.nix index 45d3c055634f..f4ca02501d00 100644 --- a/pkgs/development/python-modules/sure/default.nix +++ b/pkgs/development/python-modules/sure/default.nix @@ -28,7 +28,11 @@ buildPythonPackage rec { ''; build-system = [ setuptools ]; - dependencies = [ six ]; + + dependencies = [ + mock + six + ]; nativeCheckInputs = [ pytestCheckHook From 73e448164887d069e6586fc0c02f03885757f5af Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Aug 2024 00:24:45 +0200 Subject: [PATCH 37/43] python312Packages.proxy-py: disable failing test --- pkgs/development/python-modules/proxy-py/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/proxy-py/default.nix b/pkgs/development/python-modules/proxy-py/default.nix index aa940d50ed01..c15880933905 100644 --- a/pkgs/development/python-modules/proxy-py/default.nix +++ b/pkgs/development/python-modules/proxy-py/default.nix @@ -76,6 +76,7 @@ buildPythonPackage rec { "web_server" # Location is not writable "test_gen_csr" + "test_gen_public_key" # Tests run into a timeout "integration" ]; From ae24278745eda31a5960bc3a4a7ec151c6394168 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Aug 2024 00:25:12 +0200 Subject: [PATCH 38/43] python312Packages.aiohttp-fast-zlib: 0.1.1 -> 0.1.1 https://github.com/bdraco/aiohttp-fast-zlib/blob/v0.1.1/CHANGELOG.md --- pkgs/development/python-modules/aiohttp-fast-zlib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aiohttp-fast-zlib/default.nix b/pkgs/development/python-modules/aiohttp-fast-zlib/default.nix index e320648df3c7..3cea7804918e 100644 --- a/pkgs/development/python-modules/aiohttp-fast-zlib/default.nix +++ b/pkgs/development/python-modules/aiohttp-fast-zlib/default.nix @@ -11,14 +11,14 @@ buildPythonPackage rec { pname = "aiohttp-fast-zlib"; - version = "0.1.0"; + version = "0.1.1"; pyproject = true; src = fetchFromGitHub { owner = "bdraco"; repo = "aiohttp-fast-zlib"; rev = "v${version}"; - hash = "sha256-nR/0hVe5zAhLXu+kBOBH+whIjUV44c5yuNOj+Zl+eFo="; + hash = "sha256-uPmttfEiWmEtQrBZYwiSjLTMmXhZ0MmaAQJMXTSQj+U="; }; postPatch = '' From f22f05aa079a0944bbddb8092501cd6a0cc446d5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Aug 2024 17:40:53 +0200 Subject: [PATCH 39/43] python312Packages.chacha20poly1305-reuseable: 0.12.2 -> 0.13.2 https://github.com/bdraco/chacha20poly1305-reuseable/blob/v0.13.2/CHANGELOG.md --- .../python-modules/chacha20poly1305-reuseable/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix b/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix index 6f306f46211b..f0acd8ea7dab 100644 --- a/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix +++ b/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix @@ -18,7 +18,7 @@ let pname = "chacha20poly1305-reuseable"; - version = "0.12.2"; + version = "0.13.2"; in buildPythonPackage { @@ -31,7 +31,7 @@ buildPythonPackage { owner = "bdraco"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-RESSkMWkmlmYarLOI8pX5mwgcr8xAigbp1mrAQP/QNU="; + hash = "sha256-i6bhqfYo+gFTf3dqOBSQqGN4WPqbUR05StdwZvrVckI="; }; nativeBuildInputs = [ @@ -46,7 +46,7 @@ buildPythonPackage { preCheck = '' substituteInPlace pyproject.toml \ - --replace "--cov=chacha20poly1305_reuseable --cov-report=term-missing:skip-covered" "" + --replace-fail "--cov=chacha20poly1305_reuseable --cov-report=term-missing:skip-covered" "" ''; nativeCheckInputs = [ pytestCheckHook ]; From 06643a404d92c7371e0aab4ff3d583c791154275 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Aug 2024 18:29:27 +0200 Subject: [PATCH 40/43] python312Packages.psycopg: 3.1.19 -> 3.2.1 https://github.com/psycopg/psycopg/blob/3.2.1/docs/news.rst#current-release --- .../python-modules/psycopg/ctypes.patch | 15 ++++++++------- .../python-modules/psycopg/default.nix | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/psycopg/ctypes.patch b/pkgs/development/python-modules/psycopg/ctypes.patch index b3816d9c8d7c..98a6ba080f78 100644 --- a/pkgs/development/python-modules/psycopg/ctypes.patch +++ b/pkgs/development/python-modules/psycopg/ctypes.patch @@ -1,12 +1,13 @@ diff --git a/psycopg/psycopg/pq/_pq_ctypes.py b/psycopg/psycopg/pq/_pq_ctypes.py -index cfc68672..02929ab6 100644 +index f3a7b143..1bf935fb 100644 --- a/psycopg/psycopg/pq/_pq_ctypes.py +++ b/psycopg/psycopg/pq/_pq_ctypes.py -@@ -11,14 +11,10 @@ from ctypes import Structure, CFUNCTYPE, POINTER +@@ -13,14 +13,11 @@ from ctypes import Structure, CFUNCTYPE, POINTER from ctypes import c_char, c_char_p, c_int, c_size_t, c_ubyte, c_uint, c_void_p - from typing import List, Optional, Tuple + from typing import Any, NoReturn --from .misc import find_libpq_full_path +-from .misc import find_libpq_full_path, version_pretty ++from .misc import version_pretty from ..errors import NotSupportedError -libname = find_libpq_full_path() @@ -18,7 +19,7 @@ index cfc68672..02929ab6 100644 class FILE(Structure): -@@ -28,12 +24,7 @@ class FILE(Structure): +@@ -30,12 +27,7 @@ class FILE(Structure): FILE_ptr = POINTER(FILE) if sys.platform == "linux": @@ -33,10 +34,10 @@ index cfc68672..02929ab6 100644 fdopen = libc.fdopen fdopen.argtypes = (c_int, c_char_p) diff --git a/tests/fix_pq.py b/tests/fix_pq.py -index 917dfc91..505f2d65 100644 +index 1cff7e18..218d90a0 100644 --- a/tests/fix_pq.py +++ b/tests/fix_pq.py -@@ -47,18 +47,7 @@ def pytest_runtest_setup(item): +@@ -49,18 +49,7 @@ def pytest_runtest_setup(item): @pytest.fixture def libpq(): """Return a ctypes wrapper to access the libpq.""" diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index c98ee99f154e..7d1f8c54f3d0 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -35,13 +35,13 @@ let pname = "psycopg"; - version = "3.1.19"; + version = "3.2.1"; src = fetchFromGitHub { owner = "psycopg"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-Fvg67sGWSNwChZTO5QdLSOKrbGfxzQZJqCjI5Jidcqo="; + hash = "sha256-jQMIgfMyQpd9bD3F1IhPff39BrFaBD6U7Exryna+Acw="; }; patches = [ From eb93fae730190239110db07771f5d72699f8e17a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 5 Aug 2024 19:02:19 +0200 Subject: [PATCH 41/43] python312Packages.moto: 5.0.9 -> 5.0.12 https://github.com/getmoto/moto/blob/5.0.12/CHANGELOG.md --- pkgs/development/python-modules/moto/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index a013da79a922..3f5ae8133936 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -44,14 +44,14 @@ buildPythonPackage rec { pname = "moto"; - version = "5.0.9"; + version = "5.0.12"; pyproject = true; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-63Hxy6AccP/x8WCGrLJNbZrrMoMNZG2JifmKKa6uJLo="; + hash = "sha256-EL1DS/2jKWOf6VKUcMTCeTgGTBOZhAJOamJRPlCv9Cc="; }; build-system = [ setuptools ]; @@ -159,6 +159,9 @@ buildPythonPackage rec { # https://github.com/getmoto/moto/issues/7786 "tests/test_dynamodb/test_dynamodb_import_table.py" + + # Infinite recursion with pycognito + "tests/test_cognitoidp/test_cognitoidp.py" ]; meta = with lib; { From 9d4242c7599440bf1f8f0fa86b5d0bb62d63e048 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 5 Aug 2024 21:53:31 +0200 Subject: [PATCH 42/43] python312Packages.sqlalchemy: 2.0.31 -> 2.0.32 https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_2_0_32 --- pkgs/development/python-modules/sqlalchemy/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/sqlalchemy/default.nix b/pkgs/development/python-modules/sqlalchemy/default.nix index a40b2897cdab..426be56eea9d 100644 --- a/pkgs/development/python-modules/sqlalchemy/default.nix +++ b/pkgs/development/python-modules/sqlalchemy/default.nix @@ -41,8 +41,8 @@ buildPythonPackage rec { pname = "sqlalchemy"; - version = "2.0.31"; - format = "pyproject"; + version = "2.0.32"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -50,11 +50,14 @@ buildPythonPackage rec { owner = "sqlalchemy"; repo = "sqlalchemy"; rev = "refs/tags/rel_${lib.replaceStrings [ "." ] [ "_" ] version}"; - hash = "sha256-+bF7pdz8bxkR+mbrOI773qLoZVzBHpzKOENWPEuVFt8="; + hash = "sha256-B0T4GsTIis2ZZykRnNOFfhyfW4qU/waXeP0BS5+G1IM="; }; postPatch = '' sed -i '/tag_build = dev/d' setup.cfg + + substituteInPlace pyproject.toml \ + --replace-fail "setuptools>=61.0,<69.3" "setuptools" ''; nativeBuildInputs = [ setuptools ] ++ lib.optionals (!isPyPy) [ cython ]; From 90f0d98ccf279d47db6483292d6ddd98d74a86b0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 5 Aug 2024 22:00:08 +0200 Subject: [PATCH 43/43] python312Packages.sqlalchemy_1_4: 1.4.52 -> 1.4.53 https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_1_4_53 --- pkgs/development/python-modules/sqlalchemy/1_4.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/sqlalchemy/1_4.nix b/pkgs/development/python-modules/sqlalchemy/1_4.nix index 376570156dbd..45664292350c 100644 --- a/pkgs/development/python-modules/sqlalchemy/1_4.nix +++ b/pkgs/development/python-modules/sqlalchemy/1_4.nix @@ -36,18 +36,21 @@ buildPythonPackage rec { pname = "sqlalchemy"; - version = "1.4.52"; + version = "1.4.53"; pyproject = true; src = fetchFromGitHub { owner = "sqlalchemy"; repo = "sqlalchemy"; rev = "rel_${lib.replaceStrings [ "." ] [ "_" ] version}"; - hash = "sha256-3JiPDOI6KDQwtBtISvHi3d+Rdm0pz1d9cnZu3+f4jYE="; + hash = "sha256-CpFvL0W/X7/4N/FpufAdud5o11LHBuox8m+8EailqXg="; }; postPatch = '' sed -i '/tag_build = dev/d' setup.cfg + + substituteInPlace pyproject.toml \ + --replace-fail "setuptools>=44,<69.3" "setuptools" ''; nativeBuildInputs = [ setuptools ];