nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, attrs
4, beautifulsoup4
5, buildPythonPackage
6, click
7, fetchPypi
8, intbitset
9, pytest-xdist
10, pytestCheckHook
11, pythonAtLeast
12, pythonOlder
13, requests
14, saneyaml
15, setuptools-scm
16, text-unidecode
17, typing
18}:
19
20buildPythonPackage rec {
21 pname = "commoncode";
22 version = "30.2.0";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.6";
26
27 src = fetchPypi {
28 inherit pname version;
29 sha256 = "sha256-7kcDWfw4M7boe0ABO4ob1d+XO1YxS924mtGETvHoNf0=";
30 };
31
32 postPatch = ''
33 substituteInPlace setup.cfg \
34 --replace "intbitset >= 2.3.0, < 3.0" "intbitset >= 2.3.0"
35 '';
36
37 dontConfigure = true;
38
39 nativeBuildInputs = [
40 setuptools-scm
41 ];
42
43 propagatedBuildInputs = [
44 attrs
45 beautifulsoup4
46 click
47 intbitset
48 requests
49 saneyaml
50 text-unidecode
51 ] ++ lib.optionals (pythonOlder "3.7") [
52 typing
53 ];
54
55 checkInputs = [
56 pytestCheckHook
57 pytest-xdist
58 ];
59
60 disabledTests = lib.optionals stdenv.isDarwin [
61 # expected result is tailored towards the quirks of upstream's
62 # CI environment on darwin
63 "test_searchable_paths"
64 ];
65
66 disabledTestPaths = lib.optionals (pythonAtLeast "3.10") [
67 # https://github.com/nexB/commoncode/issues/36
68 "src/commoncode/fetch.py"
69 ];
70
71 pythonImportsCheck = [
72 "commoncode"
73 ];
74
75 meta = with lib; {
76 description = "A set of common utilities, originally split from ScanCode";
77 homepage = "https://github.com/nexB/commoncode";
78 license = licenses.asl20;
79 maintainers = teams.determinatesystems.members;
80 };
81}