git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #120009 from DeterminateSystems/scancode

python3.pkgs.scancode-toolkit: init at 21.3.31

commit8d0340aee5caac3807c58ad7fa4ebdbbdd9134d6 authorGraham Christensen <graham@grahamc.com> dateFri 23 Apr 2021, 12:41 (6 years ago) parenta773d88cdc750d
21 files changed+1015−4
pkgs/development/python-modules/banal/default.nix+27 pkgs/development/python-modules/commoncode/default.nix+55 pkgs/development/python-modules/debian-inspector/default.nix+53 pkgs/development/python-modules/dparse/default.nix+23−4 pkgs/development/python-modules/extractcode/7z.nix+48 pkgs/development/python-modules/extractcode/default.nix+60 pkgs/development/python-modules/extractcode/libarchive.nix+62 pkgs/development/python-modules/fingerprints/default.nix+42 pkgs/development/python-modules/gemfileparser/default.nix+29 pkgs/development/python-modules/intbitset/default.nix+44 pkgs/development/python-modules/intbitset/remove-impure-tuning.patch+24 pkgs/development/python-modules/normality/default.nix+42 pkgs/development/python-modules/plugincode/default.nix+47 pkgs/development/python-modules/pymaven-patch/default.nix+44 pkgs/development/python-modules/saneyaml/default.nix+41 pkgs/development/python-modules/scancode-toolkit/default.nix+122 pkgs/development/python-modules/spdx-tools/default.nix+54 pkgs/development/python-modules/typecode/default.nix+53 pkgs/development/python-modules/typecode/libmagic.nix+51 pkgs/development/python-modules/urlpy/default.nix+44 pkgs/top-level/python-packages.nix+50
pkgs/development/python-modules/banal/default.nixnew file+27
@@ -0,0 +1,27 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+}:
5+buildPythonPackage rec {
6+ pname = "banal";
7+ version = "1.0.6";
8+
9+ src = fetchPypi {
10+ inherit pname version;
11+ sha256 = "2fe02c9305f53168441948f4a03dfbfa2eacc73db30db4a93309083cb0e250a5";
12+ };
13+
14+ # no tests
15+ doCheck = false;
16+
17+ pythonImportsCheck = [
18+ "banal"
19+ ];
20+
21+ meta = with lib; {
22+ description = "Commons of banal micro-functions for Python";
23+ homepage = "https://github.com/pudo/banal";
24+ license = licenses.mit;
25+ maintainers = teams.determinatesystems.members;
26+ };
27+}
pkgs/development/python-modules/commoncode/default.nixnew file+55
@@ -0,0 +1,55 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, setuptools-scm
5+, click
6+, requests
7+, attrs
8+, intbitset
9+, saneyaml
10+, text-unidecode
11+, beautifulsoup4
12+, pytestCheckHook
13+, pytest-xdist
14+}:
15+buildPythonPackage rec {
16+ pname = "commoncode";
17+ version = "21.1.21";
18+
19+ src = fetchPypi {
20+ inherit pname version;
21+ sha256 = "6e2daa34fac2d91307b23d9df5f01a6168fdffb12bf5d161bd6776bade29b479";
22+ };
23+
24+ dontConfigure = true;
25+
26+ nativeBuildInputs = [
27+ setuptools-scm
28+ ];
29+
30+ propagatedBuildInputs = [
31+ click
32+ requests
33+ attrs
34+ intbitset
35+ saneyaml
36+ text-unidecode
37+ beautifulsoup4
38+ ];
39+
40+ checkInputs = [
41+ pytestCheckHook
42+ pytest-xdist
43+ ];
44+
45+ pythonImportsCheck = [
46+ "commoncode"
47+ ];
48+
49+ meta = with lib; {
50+ description = "A set of common utilities, originally split from ScanCode";
51+ homepage = "https://github.com/nexB/commoncode";
52+ license = licenses.asl20;
53+ maintainers = teams.determinatesystems.members;
54+ };
55+}
pkgs/development/python-modules/debian-inspector/default.nixnew file+53
@@ -0,0 +1,53 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, pythonAtLeast
5+, fetchpatch
6+, chardet
7+, attrs
8+, commoncode
9+, pytestCheckHook
10+}:
11+buildPythonPackage rec {
12+ pname = "debian-inspector";
13+ version = "0.9.10";
14+
15+ src = fetchPypi {
16+ pname = "debian_inspector";
17+ inherit version;
18+ sha256 = "fd29a02b925a4de0d7bb00c29bb05f19715a304bc10ef7b9ad06a93893dc3a8c";
19+ };
20+
21+ patches = lib.optionals (pythonAtLeast "3.9") [
22+ # https://github.com/nexB/debian-inspector/pull/15
23+ # fixes tests on Python 3.9
24+ (fetchpatch {
25+ name = "drop-encoding-argument.patch";
26+ url = "https://github.com/nexB/debian-inspector/commit/ff991cdb788671ca9b81f1602b70a439248fd1aa.patch";
27+ sha256 = "bm3k7vb9+Rm6+YicQEeDOOUVut8xpDaNavG+t2oLZkI=";
28+ })
29+ ];
30+
31+ dontConfigure = true;
32+
33+ propagatedBuildInputs = [
34+ chardet
35+ attrs
36+ commoncode
37+ ];
38+
39+ checkInputs = [
40+ pytestCheckHook
41+ ];
42+
43+ pythonImportsCheck = [
44+ "debian_inspector"
45+ ];
46+
47+ meta = with lib; {
48+ description = "Utilities to parse Debian package, copyright and control files";
49+ homepage = "https://github.com/nexB/debian-inspector";
50+ license = with licenses; [ asl20 bsd3 mit ];
51+ maintainers = teams.determinatesystems.members;
52+ };
53+}
pkgs/development/python-modules/dparse/default.nix+23−4
@@ -1,4 +1,12 @@
1−{ lib, buildPythonPackage, fetchPypi, isPy27, pytest, toml, pyyaml }:
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, isPy27
5+, toml
6+, pyyaml
7+, packaging
8+, pytestCheckHook
9+}:
210
311buildPythonPackage rec {
412 pname = "dparse";
@@ -10,13 +18,24 @@ buildPythonPackage rec {
1018 sha256 = "a1b5f169102e1c894f9a7d5ccf6f9402a836a5d24be80a986c7ce9eaed78f367";
1119 };
1220
13− propagatedBuildInputs = [ toml pyyaml ];
21+ propagatedBuildInputs = [
22+ toml
23+ pyyaml
24+ packaging
25+ ];
1426
15− checkInputs = [ pytest ];
27+ checkInputs = [
28+ pytestCheckHook
29+ ];
30+
31+ disabledTests = [
32+ # requires unpackaged dependency pipenv
33+ "test_update_pipfile"
34+ ];
1635
1736 meta = with lib; {
1837 description = "A parser for Python dependency files";
19− homepage = "https://github.com/pyupio/safety";
38+ homepage = "https://github.com/pyupio/dparse";
2039 license = licenses.mit;
2140 maintainers = with maintainers; [ thomasdesr ];
2241 };
pkgs/development/python-modules/extractcode/7z.nixnew file+48
@@ -0,0 +1,48 @@
1+{ lib
2+, fetchFromGitHub
3+, buildPythonPackage
4+, plugincode
5+, p7zip
6+}:
7+buildPythonPackage rec {
8+ pname = "extractcode-7z";
9+ version = "21.4.4";
10+
11+ src = fetchFromGitHub {
12+ owner = "nexB";
13+ repo = "scancode-plugins";
14+ rev = "v${version}";
15+ sha256 = "xnUGDMS34iMVMGo/nZwRarGzzbj3X4Rt+YHvvKpmy6A=";
16+ };
17+
18+ sourceRoot = "source/builtins/extractcode_7z-linux";
19+
20+ propagatedBuildInputs = [
21+ plugincode
22+ ];
23+
24+ preBuild = ''
25+ pushd src/extractcode_7z/bin
26+
27+ rm 7z 7z.so
28+ ln -s ${p7zip}/bin/7z 7z
29+ ln -s ${p7zip}/lib/p7zip/7z.so 7z.so
30+
31+ popd
32+ '';
33+
34+ # no tests
35+ doCheck = false;
36+
37+ pythonImportsCheck = [
38+ "extractcode_7z"
39+ ];
40+
41+ meta = with lib; {
42+ description = "A ScanCode Toolkit plugin to provide pre-built binary libraries and utilities and their locations";
43+ homepage = "https://github.com/nexB/scancode-plugins/tree/main/builtins/extractcode_7z-linux";
44+ license = with licenses; [ asl20 lgpl21 ];
45+ maintainers = teams.determinatesystems.members;
46+ platforms = platforms.linux;
47+ };
48+}
pkgs/development/python-modules/extractcode/default.nixnew file+60
@@ -0,0 +1,60 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, setuptools-scm
5+, typecode
6+, patch
7+, extractcode-libarchive
8+, extractcode-7z
9+, pytestCheckHook
10+, pytest-xdist
11+}:
12+buildPythonPackage rec {
13+ pname = "extractcode";
14+ version = "21.2.24";
15+
16+ src = fetchPypi {
17+ inherit pname version;
18+ sha256 = "f91638dbf523b80df90ac184c25d5cd1ea24cac53f67a6bb7d7b389867e0744b";
19+ };
20+
21+ dontConfigure = true;
22+
23+ nativeBuildInputs = [
24+ setuptools-scm
25+ ];
26+
27+ propagatedBuildInputs = [
28+ typecode
29+ patch
30+ extractcode-libarchive
31+ extractcode-7z
32+ ];
33+
34+ checkInputs = [
35+ pytestCheckHook
36+ pytest-xdist
37+ ];
38+
39+ # cli test tests the cli which we can't do until after install
40+ disabledTestPaths = [
41+ "tests/test_extractcode_cli.py"
42+ ];
43+
44+ # test_uncompress_* wants to use a binary to extract instead of the provided library
45+ disabledTests = [
46+ "test_uncompress_lz4_basic"
47+ "test_extract_tarlz4_basic"
48+ ];
49+
50+ pythonImportsCheck = [
51+ "extractcode"
52+ ];
53+
54+ meta = with lib; {
55+ description = "A mostly universal archive extractor using z7zip, libarchve, other libraries and the Python standard library for reliable archive extraction";
56+ homepage = "https://github.com/nexB/extractcode";
57+ license = licenses.asl20;
58+ maintainers = teams.determinatesystems.members;
59+ };
60+}
pkgs/development/python-modules/extractcode/libarchive.nixnew file+62
@@ -0,0 +1,62 @@
1+{ lib
2+, fetchFromGitHub
3+, buildPythonPackage
4+, libarchive
5+, libb2
6+, bzip2
7+, expat
8+, lz4
9+, lzma
10+, zlib
11+, zstd
12+, plugincode
13+, pytestCheckHook
14+}:
15+buildPythonPackage rec {
16+ pname = "extractcode-libarchive";
17+ version = "21.4.4";
18+
19+ src = fetchFromGitHub {
20+ owner = "nexB";
21+ repo = "scancode-plugins";
22+ rev = "v${version}";
23+ sha256 = "xnUGDMS34iMVMGo/nZwRarGzzbj3X4Rt+YHvvKpmy6A=";
24+ };
25+
26+ sourceRoot = "source/builtins/extractcode_libarchive-linux";
27+
28+ preBuild = ''
29+ pushd src/extractcode_libarchive/lib
30+
31+ rm *.so *.so.*
32+ ln -s ${lib.getLib libarchive}/lib/libarchive.so libarchive.so
33+ ln -s ${lib.getLib libb2}/lib/libb2.so libb2-la3511.so.1
34+ ln -s ${lib.getLib bzip2}/lib/libbz2.so libbz2-la3511.so.1.0
35+ ln -s ${lib.getLib expat}/lib/libexpat.so libexpat-la3511.so.1
36+ ln -s ${lib.getLib lz4}/lib/liblz4.so liblz4-la3511.so.1
37+ ln -s ${lib.getLib lzma}/lib/liblzma.so liblzma-la3511.so.5
38+ ln -s ${lib.getLib zlib}/lib/libz.so libz-la3511.so.1
39+ ln -s ${lib.getLib zstd}/lib/libzstd.so libzstd-la3511.so.1
40+
41+ popd
42+ '';
43+
44+ propagatedBuildInputs = [
45+ plugincode
46+ ];
47+
48+ # no tests
49+ doCheck = false;
50+
51+ pythonImportsCheck = [
52+ "extractcode_libarchive"
53+ ];
54+
55+ meta = with lib; {
56+ description = "A ScanCode Toolkit plugin to provide pre-built binary libraries and utilities and their locations";
57+ homepage = "https://github.com/nexB/scancode-plugins/tree/main/builtins/extractcode_libarchive-linux";
58+ license = with licenses; [ asl20 bsd2 ];
59+ maintainers = teams.determinatesystems.members;
60+ platforms = platforms.linux;
61+ };
62+}
pkgs/development/python-modules/fingerprints/default.nixnew file+42
@@ -0,0 +1,42 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, normality
5+, mypy
6+, coverage
7+, nose
8+}:
9+buildPythonPackage rec {
10+ pname = "fingerprints";
11+ version = "1.0.3";
12+
13+ src = fetchPypi {
14+ inherit pname version;
15+ sha256 = "cafd5f92b5b91e4ce34af2b954da9c05b448a4778947785abb19a14f363352d0";
16+ };
17+
18+ propagatedBuildInputs = [
19+ normality
20+ ];
21+
22+ checkInputs = [
23+ mypy
24+ coverage
25+ nose
26+ ];
27+
28+ checkPhase = ''
29+ nosetests
30+ '';
31+
32+ pythonImportsCheck = [
33+ "fingerprints"
34+ ];
35+
36+ meta = with lib; {
37+ description = "A library to generate entity fingerprints";
38+ homepage = "https://github.com/alephdata/fingerprints";
39+ license = licenses.mit;
40+ maintainers = teams.determinatesystems.members;
41+ };
42+}
pkgs/development/python-modules/gemfileparser/default.nixnew file+29
@@ -0,0 +1,29 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, pytestCheckHook
5+}:
6+buildPythonPackage rec {
7+ pname = "gemfileparser";
8+ version = "0.8.0";
9+
10+ src = fetchPypi {
11+ inherit pname version;
12+ sha256 = "839592e49ea3fd985cec003ef58f8e77009a69ed7644a0c0acc94cf6dd9b8d6e";
13+ };
14+
15+ checkInputs = [
16+ pytestCheckHook
17+ ];
18+
19+ pythonImportsCheck = [
20+ "gemfileparser"
21+ ];
22+
23+ meta = with lib; {
24+ description = "A library to parse Ruby Gemfile, .gemspec and Cocoapod .podspec file using Python";
25+ homepage = "https://github.com/gemfileparser/gemfileparser";
26+ license = with licenses; [ gpl3Plus /* or */ mit ];
27+ maintainers = teams.determinatesystems.members;
28+ };
29+}
pkgs/development/python-modules/intbitset/default.nixnew file+44
@@ -0,0 +1,44 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, six
5+, nose
6+}:
7+buildPythonPackage rec {
8+ pname = "intbitset";
9+ version = "2.4.1";
10+
11+ src = fetchPypi {
12+ inherit pname version;
13+ sha256 = "44bca80b8cc702d5a56f0686f2bb5e028ab4d0c2c1761941589d46b7fa2c701c";
14+ };
15+
16+ patches = [
17+ # fixes compilation on aarch64 and determinism (uses -march=core2 and
18+ # -mtune=native)
19+ ./remove-impure-tuning.patch
20+ ];
21+
22+ propagatedBuildInputs = [
23+ six
24+ ];
25+
26+ checkInputs = [
27+ nose
28+ ];
29+
30+ checkPhase = ''
31+ nosetests
32+ '';
33+
34+ pythonImportsCheck = [
35+ "intbitset"
36+ ];
37+
38+ meta = with lib; {
39+ description = "C-based extension implementing fast integer bit sets";
40+ homepage = "https://github.com/inveniosoftware/intbitset";
41+ license = licenses.lgpl3Only;
42+ maintainers = teams.determinatesystems.members;
43+ };
44+}
pkgs/development/python-modules/intbitset/remove-impure-tuning.patchnew file+24
@@ -0,0 +1,24 @@
1+From 2ea60bdf4d7b0344fc6ff5c97c675842fedccfa8 Mon Sep 17 00:00:00 2001
2+From: Cole Helbling <cole.e.helbling@outlook.com>
3+Date: Fri, 23 Apr 2021 09:02:22 -0700
4+Subject: [PATCH] setup.py: remove impure tuning
5+
6+---
7+ setup.py | 1 -
8+ 1 file changed, 1 deletion(-)
9+
10+diff --git a/setup.py b/setup.py
11+index 7840022..3922aa5 100644
12+--- a/setup.py
13++++ b/setup.py
14+@@ -48,7 +48,6 @@ setup(
15+ ext_modules=[
16+ Extension("intbitset",
17+ ["intbitset/intbitset.c", "intbitset/intbitset_impl.c"],
18+- extra_compile_args=['-O3', '-march=core2', '-mtune=native']
19+ # For debug -> '-ftree-vectorizer-verbose=2'
20+ )
21+ ],
22+--
23+2.30.1
24+
pkgs/development/python-modules/normality/default.nixnew file+42
@@ -0,0 +1,42 @@
1+{ lib
2+, fetchFromGitHub
3+, buildPythonPackage
4+, text-unidecode
5+, chardet
6+, banal
7+, PyICU
8+, pytestCheckHook
9+}:
10+buildPythonPackage rec {
11+ pname = "normality";
12+ version = "2.1.3";
13+
14+ src = fetchFromGitHub {
15+ owner = "pudo";
16+ repo = "normality";
17+ rev = version;
18+ sha256 = "WvpMs02vBGnCSPkxo6r6g4Di2fKkUr2SsBflTBxlhkU=";
19+ };
20+
21+ propagatedBuildInputs = [
22+ text-unidecode
23+ chardet
24+ banal
25+ PyICU
26+ ];
27+
28+ checkInputs = [
29+ pytestCheckHook
30+ ];
31+
32+ pythonImportsCheck = [
33+ "normality"
34+ ];
35+
36+ meta = with lib; {
37+ description = "Micro-library to normalize text strings";
38+ homepage = "https://github.com/pudo/normality";
39+ license = licenses.mit;
40+ maintainers = teams.determinatesystems.members;
41+ };
42+}
pkgs/development/python-modules/plugincode/default.nixnew file+47
@@ -0,0 +1,47 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, setuptools-scm
5+, click
6+, commoncode
7+, pluggy
8+, pytestCheckHook
9+, pytest-xdist
10+}:
11+buildPythonPackage rec {
12+ pname = "plugincode";
13+ version = "21.1.21";
14+
15+ src = fetchPypi {
16+ inherit pname version;
17+ sha256 = "97b5a2c96f0365c80240be103ecd86411c68b11a16f137913cbea9129c54907a";
18+ };
19+
20+ dontConfigure = true;
21+
22+ nativeBuildInputs = [
23+ setuptools-scm
24+ ];
25+
26+ propagatedBuildInputs = [
27+ click
28+ commoncode
29+ pluggy
30+ ];
31+
32+ checkInputs = [
33+ pytestCheckHook
34+ pytest-xdist
35+ ];
36+
37+ pythonImportsCheck = [
38+ "plugincode"
39+ ];
40+
41+ meta = with lib; {
42+ description = "A library that provides plugin functionality for ScanCode toolkit";
43+ homepage = "https://github.com/nexB/plugincode";
44+ license = licenses.asl20;
45+ maintainers = teams.determinatesystems.members;
46+ };
47+}
pkgs/development/python-modules/pymaven-patch/default.nixnew file+44
@@ -0,0 +1,44 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, pbr
5+, requests
6+, six
7+, lxml
8+, pytestCheckHook
9+, pytest-cov
10+, mock
11+}:
12+buildPythonPackage rec {
13+ pname = "pymaven-patch";
14+ version = "0.3.0";
15+
16+ src = fetchPypi {
17+ inherit pname version;
18+ sha256 = "d55b29bd4aeef3510904a12885eb6856b5bd48f3e29925a123461429f9ad85c0";
19+ };
20+
21+ propagatedBuildInputs = [
22+ pbr
23+ requests
24+ six
25+ lxml
26+ ];
27+
28+ checkInputs = [
29+ pytestCheckHook
30+ pytest-cov
31+ mock
32+ ];
33+
34+ pythonImportsCheck = [
35+ "pymaven"
36+ ];
37+
38+ meta = with lib; {
39+ description = "Python access to maven";
40+ homepage = "https://github.com/nexB/pymaven";
41+ license = licenses.asl20;
42+ maintainers = teams.determinatesystems.members;
43+ };
44+}
pkgs/development/python-modules/saneyaml/default.nixnew file+41
@@ -0,0 +1,41 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, setuptools-scm
5+, pyyaml
6+, pytestCheckHook
7+}:
8+buildPythonPackage rec {
9+ pname = "saneyaml";
10+ version = "0.5.2";
11+
12+ src = fetchPypi {
13+ inherit pname version;
14+ sha256 = "d6074f1959041342ab41d74a6f904720ffbcf63c94467858e0e22e17e3c43d41";
15+ };
16+
17+ dontConfigure = true;
18+
19+ nativeBuildInputs = [
20+ setuptools-scm
21+ ];
22+
23+ propagatedBuildInputs = [
24+ pyyaml
25+ ];
26+
27+ checkInputs = [
28+ pytestCheckHook
29+ ];
30+
31+ pythonImportsCheck = [
32+ "saneyaml"
33+ ];
34+
35+ meta = with lib; {
36+ description = "A PyYaml wrapper with sane behaviour to read and write readable YAML safely";
37+ homepage = "https://github.com/nexB/saneyaml";
38+ license = licenses.asl20;
39+ maintainers = teams.determinatesystems.members;
40+ };
41+}
pkgs/development/python-modules/scancode-toolkit/default.nixnew file+122
@@ -0,0 +1,122 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, isPy3k
5+, markupsafe
6+, click
7+, typecode
8+, gemfileparser
9+, pefile
10+, fingerprints
11+, spdx-tools
12+, fasteners
13+, pycryptodome
14+, urlpy
15+, dparse
16+, jaraco_functools
17+, pkginfo
18+, debian-inspector
19+, extractcode
20+, ftfy
21+, pyahocorasick
22+, colorama
23+, jsonstreams
24+, packageurl-python
25+, pymaven-patch
26+, nltk
27+, pygments
28+, bitarray
29+, jinja2
30+, javaproperties
31+, boolean-py
32+, license-expression
33+, extractcode-7z
34+, extractcode-libarchive
35+, typecode-libmagic
36+, pytestCheckHook
37+}:
38+buildPythonPackage rec {
39+ pname = "scancode-toolkit";
40+ version = "21.3.31";
41+ disabled = !isPy3k;
42+
43+ src = fetchPypi {
44+ inherit pname version;
45+ sha256 = "7e0301031a302dedbb4304a91249534f3d036f84a119170b8a9fe70bd57cff95";
46+ };
47+
48+ dontConfigure = true;
49+
50+ # https://github.com/nexB/scancode-toolkit/issues/2501
51+ # * dparse2 is a "Temp fork for Python 2 support", but pdfminer requires
52+ # Python 3, so it's "fine" to leave dparse2 unpackaged and use the "normal"
53+ # version
54+ # * ftfy was pinned for similar reasons (to support Python 2), but rather than
55+ # packaging an older version, I figured it would be better to remove the
56+ # erroneous (at least for our usage) version bound
57+ # * bitarray's version bound appears to be unnecessary for similar reasons
58+ postPatch = ''
59+ substituteInPlace setup.cfg \
60+ --replace "dparse2" "dparse" \
61+ --replace "ftfy < 5.0.0" "ftfy" \
62+ --replace "bitarray >= 0.8.1, < 1.0.0" "bitarray"
63+ '';
64+
65+ propagatedBuildInputs = [
66+ markupsafe
67+ click
68+ typecode
69+ gemfileparser
70+ pefile
71+ fingerprints
72+ spdx-tools
73+ fasteners
74+ pycryptodome
75+ urlpy
76+ dparse
77+ jaraco_functools
78+ pkginfo
79+ debian-inspector
80+ extractcode
81+ ftfy
82+ pyahocorasick
83+ colorama
84+ jsonstreams
85+ packageurl-python
86+ pymaven-patch
87+ nltk
88+ pygments
89+ bitarray
90+ jinja2
91+ javaproperties
92+ boolean-py
93+ license-expression
94+ extractcode-7z
95+ extractcode-libarchive
96+ typecode-libmagic
97+ ];
98+
99+ checkInputs = [
100+ pytestCheckHook
101+ ];
102+
103+ # Importing scancode needs a writeable home, and preCheck happens in between
104+ # pythonImportsCheckPhase and pytestCheckPhase.
105+ postInstall = ''
106+ export HOME=$(mktemp -d)
107+ '';
108+
109+ pythonImportsCheck = [
110+ "scancode"
111+ ];
112+
113+ # takes a long time and doesn't appear to do anything
114+ dontStrip = true;
115+
116+ meta = with lib; {
117+ description = "A tool to scan code for license, copyright, package and their documented dependencies and other interesting facts";
118+ homepage = "https://github.com/nexB/scancode-toolkit";
119+ license = with licenses; [ asl20 cc-by-40 ];
120+ maintainers = teams.determinatesystems.members;
121+ };
122+}
pkgs/development/python-modules/spdx-tools/default.nixnew file+54
@@ -0,0 +1,54 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, fetchpatch
5+, six
6+, pyyaml
7+, rdflib
8+, ply
9+, xmltodict
10+, pytestCheckHook
11+, pythonAtLeast
12+}:
13+buildPythonPackage rec {
14+ pname = "spdx-tools";
15+ version = "0.6.1";
16+
17+ src = fetchPypi {
18+ inherit pname version;
19+ sha256 = "9a1aaae051771e865705dd2fd374c3f73d0ad595c1056548466997551cbd7a81";
20+ };
21+
22+ patches = lib.optionals (pythonAtLeast "3.9") [
23+ # https://github.com/spdx/tools-python/pull/159
24+ # fixes tests on Python 3.9
25+ (fetchpatch {
26+ name = "drop-encoding-argument.patch";
27+ url = "https://github.com/spdx/tools-python/commit/6c8b9a852f8a787122c0e2492126ee8aa52acff0.patch";
28+ sha256 = "RhvLhexsQRjqYqJg10SAM53RsOW+R93G+mns8C9g5E8=";
29+ })
30+ ];
31+
32+ propagatedBuildInputs = [
33+ six
34+ pyyaml
35+ rdflib
36+ ply
37+ xmltodict
38+ ];
39+
40+ checkInputs = [
41+ pytestCheckHook
42+ ];
43+
44+ pythonImportsCheck = [
45+ "spdx"
46+ ];
47+
48+ meta = with lib; {
49+ description = "SPDX parser and tools";
50+ homepage = "https://github.com/spdx/tools-python";
51+ license = licenses.asl20;
52+ maintainers = teams.determinatesystems.members;
53+ };
54+}
pkgs/development/python-modules/typecode/default.nixnew file+53
@@ -0,0 +1,53 @@
1+{ lib
2+, fetchPypi
3+, buildPythonPackage
4+, setuptools-scm
5+, attrs
6+, pdfminer
7+, commoncode
8+, plugincode
9+, binaryornot
10+, typecode-libmagic
11+, pytestCheckHook
12+, pytest-xdist
13+}:
14+buildPythonPackage rec {
15+ pname = "typecode";
16+ version = "21.2.24";
17+
18+ src = fetchPypi {
19+ inherit pname version;
20+ sha256 = "eaac8aee0b9c6142ad44671252ba00748202d218347d1c0451ce6cd76561e01b";
21+ };
22+
23+ dontConfigure = true;
24+
25+ nativeBuildInputs = [
26+ setuptools-scm
27+ ];
28+
29+ propagatedBuildInputs = [
30+ attrs
31+ pdfminer
32+ commoncode
33+ plugincode
34+ binaryornot
35+ typecode-libmagic
36+ ];
37+
38+ checkInputs = [
39+ pytestCheckHook
40+ pytest-xdist
41+ ];
42+
43+ pythonImportsCheck = [
44+ "typecode"
45+ ];
46+
47+ meta = with lib; {
48+ description = "Comprehensive filetype and mimetype detection using libmagic and Pygments";
49+ homepage = "https://github.com/nexB/typecode";
50+ license = licenses.asl20;
51+ maintainers = teams.determinatesystems.members;
52+ };
53+}
pkgs/development/python-modules/typecode/libmagic.nixnew file+51
@@ -0,0 +1,51 @@
1+{ lib
2+, fetchFromGitHub
3+, buildPythonPackage
4+, plugincode
5+, file
6+, zlib
7+, pytest
8+}:
9+buildPythonPackage rec {
10+ pname = "typecode-libmagic";
11+ version = "21.4.4";
12+
13+ src = fetchFromGitHub {
14+ owner = "nexB";
15+ repo = "scancode-plugins";
16+ rev = "v${version}";
17+ sha256 = "xnUGDMS34iMVMGo/nZwRarGzzbj3X4Rt+YHvvKpmy6A=";
18+ };
19+
20+ sourceRoot = "source/builtins/typecode_libmagic-linux";
21+
22+ propagatedBuildInputs = [
23+ plugincode
24+ ];
25+
26+ preBuild = ''
27+ pushd src/typecode_libmagic
28+
29+ rm data/magic.mgc lib/libmagic.so lib/libz-lm539.so.1
30+ ln -s ${file}/share/misc/magic.mgc data/magic.mgc
31+ ln -s ${file}/lib/libmagic.so lib/libmagic.so
32+ ln -s ${zlib}/lib/libz.so lib/libz-lm539.so.1
33+
34+ popd
35+ '';
36+
37+ # no tests
38+ doCheck = false;
39+
40+ pythonImportsCheck = [
41+ "typecode_libmagic"
42+ ];
43+
44+ meta = with lib; {
45+ description = "A ScanCode Toolkit plugin to provide pre-built binary libraries and utilities and their locations";
46+ homepage = "https://github.com/nexB/scancode-plugins/tree/main/builtins/typecode_libmagic-linux";
47+ license = licenses.asl20;
48+ maintainers = teams.determinatesystems.members;
49+ platforms = platforms.linux;
50+ };
51+}
pkgs/development/python-modules/urlpy/default.nixnew file+44
@@ -0,0 +1,44 @@
1+{ lib
2+, fetchFromGitHub
3+, buildPythonPackage
4+, publicsuffix2
5+, pytestCheckHook
6+, pythonAtLeast
7+}:
8+buildPythonPackage rec {
9+ pname = "urlpy";
10+ version = "0.5.0";
11+
12+ src = fetchFromGitHub {
13+ owner = "nexB";
14+ repo = "urlpy";
15+ rev = "v${version}";
16+ sha256 = "962jLyx+/GS8wrDPzG2ONnHvtUG5Pqe6l1Z5ml63Cmg=";
17+ };
18+
19+ dontConfigure = true;
20+
21+ propagatedBuildInputs = [
22+ publicsuffix2
23+ ];
24+
25+ checkInputs = [
26+ pytestCheckHook
27+ ];
28+
29+ disabledTests = lib.optionals (pythonAtLeast "3.9") [
30+ # Fails with "AssertionError: assert 'unknown' == ''"
31+ "test_unknown_protocol"
32+ ];
33+
34+ pythonImportsCheck = [
35+ "urlpy"
36+ ];
37+
38+ meta = with lib; {
39+ description = "Simple URL parsing, canonicalization and equivalence";
40+ homepage = "https://github.com/nexB/urlpy";
41+ license = licenses.mit;
42+ maintainers = teams.determinatesystems.members;
43+ };
44+}
pkgs/top-level/python-packages.nix+50
@@ -941,6 +941,8 @@ in {
941941
942942 bacpypes = callPackage ../development/python-modules/bacpypes { };
943943
944+ banal = callPackage ../development/python-modules/banal { };
945+
944946 bandit = callPackage ../development/python-modules/bandit { };
945947
946948 bap = callPackage ../development/python-modules/bap {
@@ -1513,6 +1515,8 @@ in {
15131515
15141516 commandparse = callPackage ../development/python-modules/commandparse { };
15151517
1518+ commoncode = callPackage ../development/python-modules/commoncode { };
1519+
15161520 CommonMark = callPackage ../development/python-modules/commonmark { };
15171521
15181522 compiledb = callPackage ../development/python-modules/compiledb { };
@@ -1777,6 +1781,8 @@ in {
17771781
17781782 debian = callPackage ../development/python-modules/debian { };
17791783
1784+ debian-inspector = callPackage ../development/python-modules/debian-inspector { };
1785+
17801786 debts = callPackage ../development/python-modules/debts { };
17811787
17821788 debugpy = callPackage ../development/python-modules/debugpy { };
@@ -2295,6 +2301,24 @@ in {
22952301
22962302 exrex = callPackage ../development/python-modules/exrex { };
22972303
2304+ extractcode = callPackage ../development/python-modules/extractcode { };
2305+
2306+ extractcode-7z = callPackage ../development/python-modules/extractcode/7z.nix {
2307+ inherit (pkgs) p7zip;
2308+ };
2309+
2310+ extractcode-libarchive = callPackage ../development/python-modules/extractcode/libarchive.nix {
2311+ inherit (pkgs)
2312+ libarchive
2313+ libb2
2314+ bzip2
2315+ expat
2316+ lz4
2317+ lzma
2318+ zlib
2319+ zstd;
2320+ };
2321+
22982322 extras = callPackage ../development/python-modules/extras { };
22992323
23002324 eyeD3 = callPackage ../development/python-modules/eyed3 { };
@@ -2405,6 +2429,8 @@ in {
24052429
24062430 finalfusion = callPackage ../development/python-modules/finalfusion { };
24072431
2432+ fingerprints = callPackage ../development/python-modules/fingerprints { };
2433+
24082434 fints = callPackage ../development/python-modules/fints { };
24092435
24102436 fiona = callPackage ../development/python-modules/fiona { };
@@ -2690,6 +2716,8 @@ in {
26902716
26912717 geeknote = callPackage ../development/python-modules/geeknote { };
26922718
2719+ gemfileparser = callPackage ../development/python-modules/gemfileparser { };
2720+
26932721 genanki = callPackage ../development/python-modules/genanki { };
26942722
26952723 genome-collector = callPackage ../development/python-modules/genome-collector { };
@@ -3395,6 +3423,8 @@ in {
33953423
33963424 intake = callPackage ../development/python-modules/intake { };
33973425
3426+ intbitset = callPackage ../development/python-modules/intbitset { };
3427+
33983428 intelhex = callPackage ../development/python-modules/intelhex { };
33993429
34003430 internetarchive = callPackage ../development/python-modules/internetarchive { };
@@ -4741,6 +4771,8 @@ in {
47414771
47424772 noiseprotocol = callPackage ../development/python-modules/noiseprotocol { };
47434773
4774+ normality = callPackage ../development/python-modules/normality { };
4775+
47444776 nose2 = callPackage ../development/python-modules/nose2 { };
47454777
47464778 nose = callPackage ../development/python-modules/nose { };
@@ -5327,6 +5359,8 @@ in {
53275359
53285360 pluggy = callPackage ../development/python-modules/pluggy { };
53295361
5362+ plugincode = callPackage ../development/python-modules/plugincode { };
5363+
53305364 pluginbase = callPackage ../development/python-modules/pluginbase { };
53315365
53325366 plugnplay = callPackage ../development/python-modules/plugnplay { };
@@ -6096,6 +6130,8 @@ in {
60966130
60976131 pymatgen-lammps = callPackage ../development/python-modules/pymatgen-lammps { };
60986132
6133+ pymaven-patch = callPackage ../development/python-modules/pymaven-patch { };
6134+
60996135 pymavlink = callPackage ../development/python-modules/pymavlink { };
61006136
61016137 pymazda = callPackage ../development/python-modules/pymazda { };
@@ -7616,6 +7652,8 @@ in {
76167652 inherit (pkgs) sane-backends;
76177653 };
76187654
7655+ saneyaml = callPackage ../development/python-modules/saneyaml { };
7656+
76197657 sampledata = callPackage ../development/python-modules/sampledata { };
76207658
76217659 samplerate = callPackage ../development/python-modules/samplerate { };
@@ -7638,6 +7676,8 @@ in {
76387676
76397677 scales = callPackage ../development/python-modules/scales { };
76407678
7679+ scancode-toolkit = callPackage ../development/python-modules/scancode-toolkit { };
7680+
76417681 scandir = callPackage ../development/python-modules/scandir { };
76427682
76437683 scapy = callPackage ../development/python-modules/scapy { };
@@ -8040,6 +8080,8 @@ in {
80408080
80418081 sparse = callPackage ../development/python-modules/sparse { };
80428082
8083+ spdx-tools = callPackage ../development/python-modules/spdx-tools { };
8084+
80438085 speaklater = callPackage ../development/python-modules/speaklater { };
80448086
80458087 spectral-cube = callPackage ../development/python-modules/spectral-cube { };
@@ -8716,6 +8758,12 @@ in {
87168758
87178759 txtorcon = callPackage ../development/python-modules/txtorcon { };
87188760
8761+ typecode = callPackage ../development/python-modules/typecode { };
8762+
8763+ typecode-libmagic = callPackage ../development/python-modules/typecode/libmagic.nix {
8764+ inherit (pkgs) file zlib;
8765+ };
8766+
87198767 typed-ast = callPackage ../development/python-modules/typed-ast { };
87208768
87218769 typeguard = callPackage ../development/python-modules/typeguard { };
@@ -8844,6 +8892,8 @@ in {
88448892 else
88458893 callPackage ../development/python-modules/urllib3/2.nix { };
88468894
8895+ urlpy = callPackage ../development/python-modules/urlpy { };
8896+
88478897 urwid = callPackage ../development/python-modules/urwid { };
88488898
88498899 urwidtrees = callPackage ../development/python-modules/urwidtrees { };