From 2b87db2b51f4961d4ff9cddb009b84097ca7de7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 23 Jul 2024 06:18:16 -0700 Subject: [PATCH 1/3] python312Packages.pdfminer-six: 20231228 -> 20240706 Diff: https://github.com/pdfminer/pdfminer.six/compare/20231228...20240706 Changelog: https://github.com/pdfminer/pdfminer.six/blob/20240706/CHANGELOG.md --- .../python-modules/pdfminer-six/default.nix | 27 +++++++------------ .../disable-setuptools-git-versioning.patch | 6 +++-- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/pdfminer-six/default.nix b/pkgs/development/python-modules/pdfminer-six/default.nix index d07e11c8fcbf..1f736189e85c 100644 --- a/pkgs/development/python-modules/pdfminer-six/default.nix +++ b/pkgs/development/python-modules/pdfminer-six/default.nix @@ -2,12 +2,9 @@ lib, buildPythonPackage, fetchFromGitHub, - importlib-metadata, - isPy3k, cryptography, charset-normalizer, pythonOlder, - typing-extensions, pytestCheckHook, setuptools, substituteAll, @@ -16,16 +13,16 @@ buildPythonPackage rec { pname = "pdfminer-six"; - version = "20231228"; + version = "20240706"; pyproject = true; - disabled = !isPy3k; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "pdfminer"; repo = "pdfminer.six"; - rev = version; - hash = "sha256-LXPECQQojD3IY9zRkrDBufy4A8XUuYiRpryqUx/I3qo="; + rev = "refs/tags/${version}"; + hash = "sha256-aY7GQADRxeiclr6/G3RRgrPcl8rGiC85JYEIjIa+vG0="; }; patches = [ @@ -35,17 +32,12 @@ buildPythonPackage rec { }) ]; - nativeBuildInputs = [ setuptools ]; + build-system = [ setuptools ]; - propagatedBuildInputs = - [ - charset-normalizer - cryptography - ] - ++ lib.optionals (pythonOlder "3.8") [ - importlib-metadata - typing-extensions - ]; + dependencies = [ + charset-normalizer + cryptography + ]; postInstall = '' for file in $out/bin/*.py; do @@ -67,6 +59,7 @@ buildPythonPackage rec { }; meta = with lib; { + changelog = "https://github.com/pdfminer/pdfminer.six/blob/${src.rev}/CHANGELOG.md"; description = "PDF parser and analyzer"; homepage = "https://github.com/pdfminer/pdfminer.six"; license = licenses.mit; diff --git a/pkgs/development/python-modules/pdfminer-six/disable-setuptools-git-versioning.patch b/pkgs/development/python-modules/pdfminer-six/disable-setuptools-git-versioning.patch index 2dec0e147b9f..809cc024ff2e 100644 --- a/pkgs/development/python-modules/pdfminer-six/disable-setuptools-git-versioning.patch +++ b/pkgs/development/python-modules/pdfminer-six/disable-setuptools-git-versioning.patch @@ -1,13 +1,15 @@ +diff --git a/setup.py b/setup.py +index 42764e2..e7b93d3 100644 --- a/setup.py +++ b/setup.py -@@ -7,10 +7,7 @@ +@@ -19,10 +19,7 @@ if sys.version_info < (3, 12): setup( name="pdfminer.six", - setuptools_git_versioning={ - "enabled": True, - }, -- setup_requires=["setuptools-git-versioning<2"], +- setup_requires=["setuptools-git-versioning<3"], + version="@version@", packages=["pdfminer"], package_data={"pdfminer": ["cmap/*.pickle.gz", "py.typed"]}, From 7d63921e596f247b3bf9339b540709e2bccfbd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 24 Jul 2024 14:18:24 -0700 Subject: [PATCH 2/3] python312Packages.commoncode: don't fail if there is no /etc/os-release --- .../python-modules/commoncode/default.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/commoncode/default.nix b/pkgs/development/python-modules/commoncode/default.nix index 049cc4e09aa1..8df7ef380ab3 100644 --- a/pkgs/development/python-modules/commoncode/default.nix +++ b/pkgs/development/python-modules/commoncode/default.nix @@ -6,9 +6,9 @@ buildPythonPackage, click, fetchFromGitHub, + fetchpatch2, pytest-xdist, pytestCheckHook, - pythonAtLeast, pythonOlder, requests, saneyaml, @@ -19,7 +19,7 @@ buildPythonPackage rec { pname = "commoncode"; version = "31.2.1"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -30,11 +30,19 @@ buildPythonPackage rec { hash = "sha256-4ZgyNlMj1i1fRru4wgDOyP3qzbne8D2eH/tFI60kgrE="; }; + patches = [ + # https://github.com/nexB/commoncode/pull/66 + (fetchpatch2 { + url = "https://github.com/nexB/commoncode/commit/4f87b3c9272dcf209b9c4b997e98b58e0edaf570.patch"; + hash = "sha256-loUtAww+SK7kMt5uqZmLQ8Wg/OqB7LWVA4BiztnwHsA="; + }) + ]; + dontConfigure = true; - nativeBuildInputs = [ setuptools-scm ]; + build-system = [ setuptools-scm ]; - propagatedBuildInputs = [ + dependencies = [ attrs beautifulsoup4 click @@ -48,11 +56,6 @@ buildPythonPackage rec { pytest-xdist ]; - preCheck = '' - # prevent readout of /etc/os-release during tests - sed -i "s/is_on_ubuntu_22()/lambda _: False/" src/commoncode/system.py - ''; - disabledTests = [ # chinese character translates different into latin @@ -69,11 +72,6 @@ buildPythonPackage rec { "test_searchable_paths" ]; - disabledTestPaths = lib.optionals (pythonAtLeast "3.10") [ - # https://github.com/nexB/commoncode/issues/36 - "src/commoncode/fetch.py" - ]; - pythonImportsCheck = [ "commoncode" ]; meta = with lib; { From 45c1e0ab1637e205db02620dd1ee9d0300932bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 24 Jul 2024 14:20:46 -0700 Subject: [PATCH 3/3] python312Packages.debian-inspector: modernize --- .../python-modules/debian-inspector/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/debian-inspector/default.nix b/pkgs/development/python-modules/debian-inspector/default.nix index 571040b89fa0..b5785b93132f 100644 --- a/pkgs/development/python-modules/debian-inspector/default.nix +++ b/pkgs/development/python-modules/debian-inspector/default.nix @@ -13,9 +13,9 @@ buildPythonPackage rec { pname = "debian-inspector"; version = "31.1.0"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; src = fetchPypi { pname = "debian_inspector"; @@ -25,15 +25,17 @@ buildPythonPackage rec { dontConfigure = true; - nativeBuildInputs = [ setuptools-scm ]; + build-system = [ setuptools-scm ]; - propagatedBuildInputs = [ + dependencies = [ chardet attrs - commoncode ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + commoncode + pytestCheckHook + ]; pythonImportsCheck = [ "debian_inspector" ];