From 379857baf5b5b6a7e0ccadc4eef48975d275b2c7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 27 Oct 2024 14:19:13 +0100 Subject: [PATCH 1/3] python312Packages.zipfile2: 0.0.12 -> 0.0.12-unstable-2024-09-28 - enable tests - enable for Python 3.12 --- .../python-modules/zipfile2/default.nix | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/zipfile2/default.nix b/pkgs/development/python-modules/zipfile2/default.nix index 2d611e912c04..68b1af2e79bd 100644 --- a/pkgs/development/python-modules/zipfile2/default.nix +++ b/pkgs/development/python-modules/zipfile2/default.nix @@ -1,31 +1,43 @@ { + lib, buildPythonPackage, fetchFromGitHub, - lib, - pythonAtLeast, + pytestCheckHook, + pythonOlder, + setuptools, }: buildPythonPackage rec { pname = "zipfile2"; - version = "0.0.12"; - format = "setuptools"; + version = "0.0.12-unstable-2024-09-28"; + pyproject = true; + + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "cournape"; - repo = pname; - rev = "v${version}"; - hash = "sha256-BwcEgW4XrQqz0Jmtbyxf8q0mWTJXv2dL3Tk7N/IYuMI="; + repo = "zipfile2"; + #rev = "refs/tags/v${version}"; + rev = "8823f7253772e5c5811343306a591c00c764c6d0"; + hash = "sha256-jDOyIj0sQS1dIsar4nyk5V2mme3Zc6VTms49/4n93ho="; }; - patches = [ ./no-setuid.patch ]; + build-system = [ setuptools ]; + + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "zipfile2" ]; + disabledTests = [ + # PermissionError: [Errno 1] Operation not ... + "test_extract" + ]; + meta = with lib; { - homepage = "https://github.com/cournape/zipfile2"; description = "Backwards-compatible improved zipfile class"; - maintainers = with maintainers; [ genericnerdyusername ]; + homepage = "https://github.com/cournape/zipfile2"; + changelog = "https://github.com/itziakos/zipfile2/releases/tag/v${version}"; license = licenses.psfl; - broken = pythonAtLeast "3.12"; # tests are failing because the signature of ZipInfo._decodeExtra changed + maintainers = with maintainers; [ genericnerdyusername ]; }; } From 15cfb56406c8ab4c04dccd4deb5a498b3a309680 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 27 Oct 2024 14:28:31 +0100 Subject: [PATCH 2/3] python312Packages.okonomiyaki: 1.4.0 -> 2.0.0 Changelog: https://github.com/enthought/okonomiyaki/releases/tag/2.0.0 --- .../python-modules/okonomiyaki/default.nix | 80 ++++++++++++------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/pkgs/development/python-modules/okonomiyaki/default.nix b/pkgs/development/python-modules/okonomiyaki/default.nix index d8b909b9a571..bdcddc59c7a7 100644 --- a/pkgs/development/python-modules/okonomiyaki/default.nix +++ b/pkgs/development/python-modules/okonomiyaki/default.nix @@ -1,64 +1,86 @@ { - buildPythonPackage, - stdenv, - fetchFromGitHub, lib, + stdenv, attrs, + buildPythonPackage, distro, + fetchFromGitHub, + parameterized, jsonschema, - six, - zipfile2, - hypothesis, mock, packaging, + pytestCheckHook, + pythonOlder, + setuptools, testfixtures, - pythonAtLeast, + zipfile2, }: buildPythonPackage rec { pname = "okonomiyaki"; - version = "1.4.0"; - format = "setuptools"; + version = "2.0.0"; + pyproject = true; + + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "enthought"; - repo = pname; + repo = "okonomiyaki"; rev = "refs/tags/${version}"; - hash = "sha256-MEll1H7l41m8uz2/WK/Ilm7Dubg0uqYwe+ZgakO1aXQ="; + hash = "sha256-JQZhw0H4iSdxoyS6ODICJz1vAZsOISQitX7wTgSS1xc="; }; - propagatedBuildInputs = [ - distro - attrs - jsonschema - six - zipfile2 - ]; + postPatch = '' + # Fixed for >= 2.0.0 + substituteInPlace setup.cfg \ + --replace-fail "long_description_content_type = rst" "long_description_content_type = text/x-rst" + ''; + + build-system = [ setuptools ]; + + optional-dependencies = { + all = [ + attrs + distro + jsonschema + zipfile2 + ]; + platforms = [ + attrs + distro + ]; + formats = [ + attrs + distro + jsonschema + zipfile2 + ]; + }; + + nativeCheckInputs = [ + packaging + parameterized + pytestCheckHook + testfixtures + ] ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' substituteInPlace okonomiyaki/runtimes/tests/test_runtime.py \ - --replace 'runtime_info = PythonRuntime.from_running_python()' 'raise unittest.SkipTest() #' + --replace-fail 'runtime_info = PythonRuntime.from_running_python()' 'raise unittest.SkipTest() #' '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace okonomiyaki/platforms/tests/test_pep425.py \ - --replace 'self.assertEqual(platform_tag, self.tag.platform)' 'raise unittest.SkipTest()' + --replace-fail 'self.assertEqual(platform_tag, self.tag.platform)' 'raise unittest.SkipTest()' ''; - checkInputs = [ - hypothesis - mock - packaging - testfixtures - ]; - pythonImportsCheck = [ "okonomiyaki" ]; meta = with lib; { - homepage = "https://github.com/enthought/okonomiyaki"; description = "Experimental library aimed at consolidating a lot of low-level code used for Enthought's eggs"; + homepage = "https://github.com/enthought/okonomiyaki"; + changelog = "https://github.com/enthought/okonomiyaki/releases/tag/${version}"; maintainers = with maintainers; [ genericnerdyusername ]; license = licenses.bsd3; - broken = pythonAtLeast "3.12"; # multiple tests are failing }; } From 7acd467a6c454e310eb3f4a1f38b04b5cd71a04f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 27 Oct 2024 14:44:44 +0100 Subject: [PATCH 3/3] python312Packages.simplesat: 0.9.0 -> 0.9.1 Diff: https://github.com/enthought/sat-solver/compare/refs/tags/v0.9.0...v0.9.1 Changelog: https://github.com/enthought/sat-solver/blob/v0.9.1/CHANGES.rst --- .../python-modules/simplesat/default.nix | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/simplesat/default.nix b/pkgs/development/python-modules/simplesat/default.nix index 3f81b311c811..35359c29396d 100644 --- a/pkgs/development/python-modules/simplesat/default.nix +++ b/pkgs/development/python-modules/simplesat/default.nix @@ -1,42 +1,34 @@ { - buildPythonPackage, - fetchFromGitHub, - writeText, lib, attrs, + buildPythonPackage, + fetchFromGitHub, mock, okonomiyaki, pytestCheckHook, + pythonOlder, pyyaml, setuptools, six, }: -let - version = "0.9.0"; - versionFile = writeText "simplesat_ver" '' - version = '${version}' - full_version = '${version}' - git_revision = '0000000000000000000000000000000000000000' - is_released = True - msi_version = '${version}.000' - version_info = (${lib.versions.major version}, ${lib.versions.minor version}, ${lib.versions.patch version}, 'final', 0) - ''; -in buildPythonPackage rec { pname = "simplesat"; - inherit version; + version = "0.9.1"; pyproject = true; + disabled = pythonOlder "3.9"; + src = fetchFromGitHub { owner = "enthought"; repo = "sat-solver"; rev = "refs/tags/v${version}"; - hash = "sha256-8sUOV42MLM3otG3EKvVzKKGAUpSlaTj850QZxZa62bE="; + hash = "sha256-/fBnpf1DtaF+wQYZztcB8Y20/ZMYxrF3fH5qRsMucL0="; }; - preConfigure = '' - cp ${versionFile} simplesat/_version.py + postPatch = '' + substituteInPlace setup.cfg \ + --replace-fail "version = file: VERSION" "version = ${version}" ''; build-system = [ setuptools ]; @@ -47,20 +39,26 @@ buildPythonPackage rec { six ]; - pythonImportsCheck = [ "simplesat" ]; - nativeCheckInputs = [ mock pytestCheckHook pyyaml ]; + pythonImportsCheck = [ "simplesat" ]; + + preCheck = '' + substituteInPlace simplesat/tests/test_pool.py \ + --replace-fail "assertRaisesRegexp" "assertRaisesRegex" + ''; + pytestFlagsArray = [ "simplesat/tests" ]; meta = with lib; { - homepage = "https://github.com/enthought/sat-solver"; description = "Prototype for SAT-based dependency handling"; - maintainers = with maintainers; [ genericnerdyusername ]; + homepage = "https://github.com/enthought/sat-solver"; + changelog = "https://github.com/enthought/sat-solver/blob/v${version}/CHANGES.rst"; license = licenses.bsd3; + maintainers = with maintainers; [ genericnerdyusername ]; }; }