2021-04-25 03:57:28 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, stdenv
|
2021-10-11 16:52:03 +00:00
|
|
|
, attrs
|
|
|
|
, beautifulsoup4
|
2021-04-25 03:57:28 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
2021-10-11 16:52:03 +00:00
|
|
|
, fetchPypi
|
2021-04-25 03:57:28 +00:00
|
|
|
, intbitset
|
2021-10-11 16:52:03 +00:00
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
2022-01-19 23:45:15 +00:00
|
|
|
, pythonAtLeast
|
2021-10-11 16:52:03 +00:00
|
|
|
, pythonOlder
|
|
|
|
, requests
|
2021-04-25 03:57:28 +00:00
|
|
|
, saneyaml
|
2021-10-11 16:52:03 +00:00
|
|
|
, setuptools-scm
|
2021-04-25 03:57:28 +00:00
|
|
|
, text-unidecode
|
2021-10-11 16:52:03 +00:00
|
|
|
, typing
|
2021-04-25 03:57:28 +00:00
|
|
|
}:
|
2021-10-11 16:52:03 +00:00
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "commoncode";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "31.0.2";
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2021-10-11 16:52:03 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-UWd8fTHVEC5ywETfMIWjfXm4xiNaMrVpwkQ/woeXc0k=";
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "intbitset >= 2.3.0, < 3.0" "intbitset >= 2.3.0"
|
|
|
|
'';
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
2021-10-11 16:52:03 +00:00
|
|
|
beautifulsoup4
|
|
|
|
click
|
2021-04-25 03:57:28 +00:00
|
|
|
intbitset
|
2021-10-11 16:52:03 +00:00
|
|
|
requests
|
2021-04-25 03:57:28 +00:00
|
|
|
saneyaml
|
|
|
|
text-unidecode
|
2021-10-11 16:52:03 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.7") [
|
|
|
|
typing
|
2021-04-25 03:57:28 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-25 03:57:28 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
];
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabledTests = [
|
|
|
|
# chinese character translates different into latin
|
|
|
|
"test_safe_path_posix_style_chinese_char"
|
|
|
|
# OSError: [Errno 84] Invalid or incomplete multibyte or wide character
|
|
|
|
"test_os_walk_can_walk_non_utf8_path_from_unicode_path"
|
|
|
|
"test_resource_iter_can_walk_non_utf8_path_from_unicode_path"
|
|
|
|
"test_walk_can_walk_non_utf8_path_from_unicode_path"
|
|
|
|
"test_resource_iter_can_walk_non_utf8_path_from_unicode_path_with_dirs"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-12-06 16:07:01 +00:00
|
|
|
# expected result is tailored towards the quirks of upstream's
|
|
|
|
# CI environment on darwin
|
|
|
|
"test_searchable_paths"
|
|
|
|
];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
disabledTestPaths = lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# https://github.com/nexB/commoncode/issues/36
|
|
|
|
"src/commoncode/fetch.py"
|
|
|
|
];
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"commoncode"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A set of common utilities, originally split from ScanCode";
|
|
|
|
homepage = "https://github.com/nexB/commoncode";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.determinatesystems.members;
|
|
|
|
};
|
|
|
|
}
|