1{ lib 2, attrs 3, beautifulsoup4 4, bitarray 5, boolean-py 6, buildPythonPackage 7, chardet 8, click 9, colorama 10, commoncode 11, debian-inspector 12, dparse 13, extractcode 14, extractcode-7z 15, extractcode-libarchive 16, fasteners 17, fetchPypi 18, fingerprints 19, ftfy 20, gemfileparser 21, html5lib 22, importlib-metadata 23, intbitset 24, jaraco_functools 25, javaproperties 26, jinja2 27, jsonstreams 28, license-expression 29, lxml 30, markupsafe 31, packageurl-python 32, packaging 33, parameter-expansion-patched 34, pefile 35, pkginfo 36, pluggy 37, plugincode 38, publicsuffix2 39, pyahocorasick 40, pycryptodome 41, pygmars 42, pygments 43, pymaven-patch 44, pytestCheckHook 45, pythonOlder 46, requests 47, saneyaml 48, spdx-tools 49, text-unidecode 50, toml 51, typecode 52, typecode-libmagic 53, typing 54, urlpy 55, xmltodict 56, zipp 57}: 58 59buildPythonPackage rec { 60 pname = "scancode-toolkit"; 61 version = "30.1.0"; 62 63 disabled = pythonOlder "3.6"; 64 65 src = fetchPypi { 66 inherit pname version; 67 sha256 = "sha256-UYQf+cBi2FmyZxIbQJo7vLjPuoePIMC8FugvoG1Ebj0="; 68 }; 69 70 dontConfigure = true; 71 72 propagatedBuildInputs = [ 73 attrs 74 beautifulsoup4 75 bitarray 76 boolean-py 77 chardet 78 click 79 colorama 80 commoncode 81 debian-inspector 82 dparse 83 extractcode 84 extractcode-7z 85 extractcode-libarchive 86 fasteners 87 fingerprints 88 ftfy 89 gemfileparser 90 html5lib 91 intbitset 92 jaraco_functools 93 javaproperties 94 jinja2 95 jsonstreams 96 license-expression 97 lxml 98 markupsafe 99 packageurl-python 100 packaging 101 parameter-expansion-patched 102 pefile 103 pkginfo 104 pluggy 105 plugincode 106 publicsuffix2 107 pyahocorasick 108 pycryptodome 109 pygmars 110 pygments 111 pymaven-patch 112 requests 113 saneyaml 114 spdx-tools 115 text-unidecode 116 toml 117 typecode 118 typecode-libmagic 119 urlpy 120 xmltodict 121 zipp 122 ] ++ lib.optionals (pythonOlder "3.9") [ 123 importlib-metadata 124 ] ++ lib.optionals (pythonOlder "3.7") [ 125 typing 126 ]; 127 128 checkInputs = [ 129 pytestCheckHook 130 ]; 131 132 postPatch = '' 133 substituteInPlace setup.cfg \ 134 --replace "pluggy >= 0.12.0, < 1.0" "pluggy" \ 135 --replace "pygmars >= 0.7.0" "pygmars" \ 136 --replace "license_expression >= 21.6.14" "license_expression" 137 ''; 138 139 # Importing scancode needs a writeable home, and preCheck happens in between 140 # pythonImportsCheckPhase and pytestCheckPhase. 141 postInstall = '' 142 export HOME=$(mktemp -d) 143 ''; 144 145 pythonImportsCheck = [ 146 "scancode" 147 ]; 148 149 # takes a long time and doesn't appear to do anything 150 dontStrip = true; 151 152 meta = with lib; { 153 description = "Tool to scan code for license, copyright, package and their documented dependencies and other interesting facts"; 154 homepage = "https://github.com/nexB/scancode-toolkit"; 155 license = with licenses; [ asl20 cc-by-40 ]; 156 maintainers = teams.determinatesystems.members; 157 }; 158}