From 65fe62e0205e941d3be226ff5dee3aae00c00c08 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 10:55:32 +0200 Subject: [PATCH 1/8] python3Packages.commoncode: 21.8.31 -> 30.0.0 --- .../python-modules/commoncode/default.nix | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/commoncode/default.nix b/pkgs/development/python-modules/commoncode/default.nix index 136a638c352c..04921a618c25 100644 --- a/pkgs/development/python-modules/commoncode/default.nix +++ b/pkgs/development/python-modules/commoncode/default.nix @@ -1,24 +1,29 @@ { lib -, fetchPypi -, buildPythonPackage -, setuptools-scm -, click -, requests , attrs -, intbitset -, saneyaml -, text-unidecode , beautifulsoup4 -, pytestCheckHook +, buildPythonPackage +, click +, fetchPypi +, intbitset , pytest-xdist +, pytestCheckHook +, pythonOlder +, requests +, saneyaml +, setuptools-scm +, text-unidecode +, typing }: + buildPythonPackage rec { pname = "commoncode"; - version = "21.8.31"; + version = "30.0.0"; + + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "0e74c61226834393801e921ab125eae3b52361340278fb9a468c5c691d286c32"; + sha256 = "sha256-6SeU4u6pfDuGCgCYAO5fdbWBxW9XN3WvM8j6DwUlFwM="; }; dontConfigure = true; @@ -28,13 +33,15 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - click - requests attrs + beautifulsoup4 + click intbitset + requests saneyaml text-unidecode - beautifulsoup4 + ] ++ lib.optionals (pythonOlder "3.7") [ + typing ]; checkInputs = [ From 166770817df5f260b1ace224eafece4209507239 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 11:13:47 +0200 Subject: [PATCH 2/8] python3Packages.extractcode: disable failing test --- pkgs/development/python-modules/extractcode/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/extractcode/default.nix b/pkgs/development/python-modules/extractcode/default.nix index a39205f5aeea..c4f6ecc537bc 100644 --- a/pkgs/development/python-modules/extractcode/default.nix +++ b/pkgs/development/python-modules/extractcode/default.nix @@ -9,6 +9,7 @@ , pytestCheckHook , pytest-xdist }: + buildPythonPackage rec { pname = "extractcode"; version = "21.7.23"; @@ -36,7 +37,7 @@ buildPythonPackage rec { pytest-xdist ]; - # cli test tests the cli which we can't do until after install + # CLI test tests the cli which we can't do until after install disabledTestPaths = [ "tests/test_extractcode_cli.py" ]; @@ -45,6 +46,7 @@ buildPythonPackage rec { disabledTests = [ "test_uncompress_lz4_basic" "test_extract_tarlz4_basic" + "test_extract_rar_with_trailing_data" # tries to parse /boot/vmlinuz-*, which is not available in the nix sandbox "test_can_extract_qcow2_vm_image_as_tarball" "test_can_extract_qcow2_vm_image_not_as_tarball" @@ -56,7 +58,7 @@ buildPythonPackage rec { ]; meta = with lib; { - description = "A mostly universal archive extractor using z7zip, libarchve, other libraries and the Python standard library for reliable archive extraction"; + description = "Universal archive extractor using z7zip, libarchve, other libraries and the Python standard library"; homepage = "https://github.com/nexB/extractcode"; license = licenses.asl20; maintainers = teams.determinatesystems.members; From 291d63f8884b6716525debd7d114aa39f03ad252 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 11:45:11 +0200 Subject: [PATCH 3/8] python3Packages.pygmars: init at 0.7.0 --- .../python-modules/pygmars/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/pygmars/default.nix diff --git a/pkgs/development/python-modules/pygmars/default.nix b/pkgs/development/python-modules/pygmars/default.nix new file mode 100644 index 000000000000..e0764ecb3a4b --- /dev/null +++ b/pkgs/development/python-modules/pygmars/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, setuptools-scm +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pygmars"; + version = "0.7.0"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "nexB"; + repo = pname; + rev = "v${version}"; + sha256 = "0wghk4nzplpl26iwrgvm0n9x88nyxlcxz4ywss4nwdr4hfccl28l"; + }; + + dontConfigure = true; + + nativeBuildInputs = [ + setuptools-scm + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "pygmars" + ]; + + meta = with lib; { + description = "Python lexing and parsing library"; + homepage = "https://github.com/nexB/pygmars"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 95af7eef4d72..8ba96b34e44f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6310,6 +6310,8 @@ in { pygls = callPackage ../development/python-modules/pygls { }; + pygmars = callPackage ../development/python-modules/pygmars { }; + pygments-better-html = callPackage ../development/python-modules/pygments-better-html { }; pygments = callPackage ../development/python-modules/Pygments { }; From 6423dc7828e57abceebcbfdd707b1463a937fc37 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 11:52:40 +0200 Subject: [PATCH 4/8] python3Packages.spdx-tools: 0.6.1 -> 0.7.0a3 --- .../python-modules/spdx-tools/default.nix | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/spdx-tools/default.nix b/pkgs/development/python-modules/spdx-tools/default.nix index 53d6d51d2d28..d35846a11017 100644 --- a/pkgs/development/python-modules/spdx-tools/default.nix +++ b/pkgs/development/python-modules/spdx-tools/default.nix @@ -1,39 +1,31 @@ { lib , buildPythonPackage +, click , fetchPypi -, fetchpatch -, six , pyyaml , rdflib , ply , xmltodict , pytestCheckHook -, pythonAtLeast +, pythonOlder }: + buildPythonPackage rec { pname = "spdx-tools"; - version = "0.6.1"; + version = "0.7.0a3"; + + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "9a1aaae051771e865705dd2fd374c3f73d0ad595c1056548466997551cbd7a81"; + sha256 = "sha256-afV1W1n5ubHhqfLFpPO5fxaIy5TaZdw9eDy3JYOJ1oE="; }; - patches = lib.optionals (pythonAtLeast "3.9") [ - # https://github.com/spdx/tools-python/pull/159 - # fixes tests on Python 3.9 - (fetchpatch { - name = "drop-encoding-argument.patch"; - url = "https://github.com/spdx/tools-python/commit/6c8b9a852f8a787122c0e2492126ee8aa52acff0.patch"; - sha256 = "RhvLhexsQRjqYqJg10SAM53RsOW+R93G+mns8C9g5E8="; - }) - ]; - propagatedBuildInputs = [ - six + click + ply pyyaml rdflib - ply xmltodict ]; From 4521bf49d19efe245e02ec923296155eb8ae75b9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 12:05:28 +0200 Subject: [PATCH 5/8] python3Packages.parameter-expansion-patched: init at 0.2.1b4 --- .../parameter-expansion-patched/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/parameter-expansion-patched/default.nix diff --git a/pkgs/development/python-modules/parameter-expansion-patched/default.nix b/pkgs/development/python-modules/parameter-expansion-patched/default.nix new file mode 100644 index 000000000000..18511e1c70fd --- /dev/null +++ b/pkgs/development/python-modules/parameter-expansion-patched/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "parameter-expansion-patched"; + version = "0.2.1b4"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "1vhshscjifi78qapzwn29gln6p8jhyc7cccszl8ai2jamhcph5zs"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "parameter_expansion" + ]; + + meta = with lib; { + description = "POSIX parameter expansion in Python"; + homepage = "https://github.com/nexB/commoncode"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8ba96b34e44f..cd1e4e00eccc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5332,6 +5332,8 @@ in { param = callPackage ../development/python-modules/param { }; + parameter-expansion-patched = callPackage ../development/python-modules/parameter-expansion-patched { }; + parameterized = callPackage ../development/python-modules/parameterized { }; paramiko = callPackage ../development/python-modules/paramiko { }; From 54caa4135aa584aead70ce80f169eb5980ddfed9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 12:07:07 +0200 Subject: [PATCH 6/8] python3Packages.debian-inspector: 21.5.25 -> 30.0.0 --- pkgs/development/python-modules/debian-inspector/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/debian-inspector/default.nix b/pkgs/development/python-modules/debian-inspector/default.nix index e19694bcf9c8..b91e26f71467 100644 --- a/pkgs/development/python-modules/debian-inspector/default.nix +++ b/pkgs/development/python-modules/debian-inspector/default.nix @@ -11,12 +11,12 @@ buildPythonPackage rec { pname = "debian-inspector"; - version = "21.5.25"; + version = "30.0.0"; src = fetchPypi { pname = "debian_inspector"; inherit version; - sha256 = "1d3xaqw00kav85nk29qm2yqb73bkyqf185fs1q0vgd7bnap9wqaw"; + sha256 = "sha256-0PT5sT6adaqgYQtWjks12ys0z1C3n116aeJaEKR/Wxg="; }; nativeBuildInputs = [ From 570e2536e8cf525b54f2cc32f61a702c4885edbf Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 12:17:44 +0200 Subject: [PATCH 7/8] python3Packages.license-expression: 1.2 -> 21.6.14 --- .../license-expression/default.nix | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/license-expression/default.nix b/pkgs/development/python-modules/license-expression/default.nix index e934c5194285..5ed61931a7d8 100644 --- a/pkgs/development/python-modules/license-expression/default.nix +++ b/pkgs/development/python-modules/license-expression/default.nix @@ -1,25 +1,45 @@ -{ lib, buildPythonPackage, fetchFromGitHub +{ lib , boolean-py +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, setuptools-scm }: buildPythonPackage rec { pname = "license-expression"; - version = "1.2"; + version = "21.6.14"; + + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "nexB"; repo = "license-expression"; rev = "v${version}"; - sha256 = "0bbd7d90z58p9sd01b00g0vfd9bmwzksjb7pc8833s2jpja9mxz1"; + sha256 = "sha256-hwfYKKalo8WYFwPCsRRXNz+/F8/42PXA8jxbIQjJH/g="; }; - postPatch = "patchShebangs ./configure"; - propagatedBuildInputs = [ boolean-py ]; + dontConfigure = true; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + boolean-py + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "license_expression" ]; meta = with lib; { + description = "Utility library to parse, normalize and compare License expressions for Python"; homepage = "https://github.com/nexB/license-expression"; - description = "Utility library to parse, normalize and compare License expressions for Python using a boolean logic engine"; license = licenses.asl20; + maintainers = with maintainers; [ fab ]; }; - } From e531a5a7120816144b6e653d6fc186d64f6b9fd9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Oct 2021 12:23:06 +0200 Subject: [PATCH 8/8] python3Packages.scancode-toolkit: 21.8.4 -> 30.1.0 --- .../scancode-toolkit/default.nix | 186 +++++++++++------- 1 file changed, 111 insertions(+), 75 deletions(-) diff --git a/pkgs/development/python-modules/scancode-toolkit/default.nix b/pkgs/development/python-modules/scancode-toolkit/default.nix index 177032aea7f3..afde27967dbb 100644 --- a/pkgs/development/python-modules/scancode-toolkit/default.nix +++ b/pkgs/development/python-modules/scancode-toolkit/default.nix @@ -1,105 +1,141 @@ { lib -, fetchPypi -, buildPythonPackage -, isPy3k -, markupsafe -, click -, typecode -, gemfileparser -, pefile -, fingerprints -, spdx-tools -, fasteners -, pycryptodome -, urlpy -, dparse -, jaraco_functools -, pkginfo -, debian-inspector -, extractcode -, ftfy -, pyahocorasick -, colorama -, jsonstreams -, packageurl-python -, pymaven-patch -, nltk -, pygments +, attrs +, beautifulsoup4 , bitarray -, jinja2 -, javaproperties , boolean-py -, license-expression +, buildPythonPackage +, chardet +, click +, colorama +, commoncode +, debian-inspector +, dparse +, extractcode , extractcode-7z , extractcode-libarchive -, typecode-libmagic +, fasteners +, fetchPypi +, fingerprints +, ftfy +, gemfileparser +, html5lib +, importlib-metadata +, intbitset +, jaraco_functools +, javaproperties +, jinja2 +, jsonstreams +, license-expression +, lxml +, markupsafe +, packageurl-python +, packaging +, parameter-expansion-patched +, pefile +, pkginfo +, pluggy +, plugincode +, publicsuffix2 +, pyahocorasick +, pycryptodome +, pygmars +, pygments +, pymaven-patch , pytestCheckHook +, pythonOlder +, requests +, saneyaml +, spdx-tools +, text-unidecode +, toml +, typecode +, typecode-libmagic +, typing +, urlpy +, xmltodict +, zipp }: + buildPythonPackage rec { pname = "scancode-toolkit"; - version = "21.8.4"; - disabled = !isPy3k; + version = "30.1.0"; + + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "c18340067244274c67e166f701c60e747e1d0bccb17efc99f277a4bc0a5a13c6"; + sha256 = "sha256-UYQf+cBi2FmyZxIbQJo7vLjPuoePIMC8FugvoG1Ebj0="; }; dontConfigure = true; - # https://github.com/nexB/scancode-toolkit/issues/2501 - # * dparse2 is a "Temp fork for Python 2 support", but pdfminer requires - # Python 3, so it's "fine" to leave dparse2 unpackaged and use the "normal" - # version - # * ftfy was pinned for similar reasons (to support Python 2), but rather than - # packaging an older version, I figured it would be better to remove the - # erroneous (at least for our usage) version bound - # * bitarray's version bound appears to be unnecessary for similar reasons - postPatch = '' - substituteInPlace setup.cfg \ - --replace "dparse2" "dparse" \ - --replace "ftfy < 5.0.0" "ftfy" \ - --replace "bitarray >= 0.8.1, < 1.0.0" "bitarray" - ''; - propagatedBuildInputs = [ - markupsafe - click - typecode - gemfileparser - pefile - fingerprints - spdx-tools - fasteners - pycryptodome - urlpy - dparse - jaraco_functools - pkginfo - debian-inspector - extractcode - ftfy - pyahocorasick - colorama - jsonstreams - packageurl-python - pymaven-patch - nltk - pygments + attrs + beautifulsoup4 bitarray - jinja2 - javaproperties boolean-py - license-expression + chardet + click + colorama + commoncode + debian-inspector + dparse + extractcode extractcode-7z extractcode-libarchive + fasteners + fingerprints + ftfy + gemfileparser + html5lib + intbitset + jaraco_functools + javaproperties + jinja2 + jsonstreams + license-expression + lxml + markupsafe + packageurl-python + packaging + parameter-expansion-patched + pefile + pkginfo + pluggy + plugincode + publicsuffix2 + pyahocorasick + pycryptodome + pygmars + pygments + pymaven-patch + requests + saneyaml + spdx-tools + text-unidecode + toml + typecode typecode-libmagic + urlpy + xmltodict + zipp + ] ++ lib.optionals (pythonOlder "3.9") [ + importlib-metadata + ] ++ lib.optionals (pythonOlder "3.7") [ + typing ]; checkInputs = [ pytestCheckHook ]; + postPatch = '' + substituteInPlace setup.cfg \ + --replace "pluggy >= 0.12.0, < 1.0" "pluggy" \ + --replace "pygmars >= 0.7.0" "pygmars" \ + --replace "license_expression >= 21.6.14" "license_expression" + ''; + # Importing scancode needs a writeable home, and preCheck happens in between # pythonImportsCheckPhase and pytestCheckPhase. postInstall = '' @@ -114,7 +150,7 @@ buildPythonPackage rec { dontStrip = true; meta = with lib; { - description = "A tool to scan code for license, copyright, package and their documented dependencies and other interesting facts"; + description = "Tool to scan code for license, copyright, package and their documented dependencies and other interesting facts"; homepage = "https://github.com/nexB/scancode-toolkit"; license = with licenses; [ asl20 cc-by-40 ]; maintainers = teams.determinatesystems.members;