2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
attrs,
|
|
|
|
beautifulsoup4,
|
|
|
|
buildPythonPackage,
|
|
|
|
click,
|
|
|
|
fetchPypi,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
saneyaml,
|
|
|
|
setuptools-scm,
|
|
|
|
text-unidecode,
|
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-10-09 19:29:22 +00:00
|
|
|
version = "31.0.3";
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2021-10-11 16:52:03 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-ura55/m/iesqN6kSYmdHB1sbthSHXaFWiQ76wVmyl0E=";
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
2021-10-11 16:52:03 +00:00
|
|
|
beautifulsoup4
|
|
|
|
click
|
|
|
|
requests
|
2021-04-25 03:57:28 +00:00
|
|
|
saneyaml
|
|
|
|
text-unidecode
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
2024-06-05 15:53:02 +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 [
|
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "commoncode" ];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A set of common utilities, originally split from ScanCode";
|
|
|
|
homepage = "https://github.com/nexB/commoncode";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/nexB/commoncode/blob/v${version}/CHANGELOG.rst";
|
2021-04-25 03:57:28 +00:00
|
|
|
license = licenses.asl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
}
|