2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
isPyPy,
|
|
|
|
mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
simplejson,
|
|
|
|
twisted,
|
|
|
|
versioneer,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyutil";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.3.6";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-XcPWu5xbq6u10Ldz4JQEXXVxLos0ry0psOKGAmaCZ8A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
prePatch = lib.optionalString isPyPy ''
|
2020-04-24 23:36:52 +00:00
|
|
|
grep -rl 'utf-8-with-signature-unix' ./ | xargs sed -i -e "s|utf-8-with-signature-unix|utf-8|g"
|
|
|
|
'';
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
versioneer
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
jsonutil = [ simplejson ];
|
2024-01-25 14:12:00 +00:00
|
|
|
# Module not available
|
|
|
|
# randcookie = [
|
|
|
|
# zbase32
|
|
|
|
# ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
mock
|
|
|
|
twisted
|
|
|
|
pytestCheckHook
|
2024-10-04 16:56:33 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues optional-dependencies);
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pyutil" ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# https://github.com/tpltnt/pyutil/issues/10
|
|
|
|
"test_decimal"
|
|
|
|
"test_float"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Collection of mature utilities for Python programmers";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
These are a few data structures, classes and functions which
|
|
|
|
we've needed over many years of Python programming and which
|
|
|
|
seem to be of general use to other Python programmers. Many of
|
|
|
|
the modules that have existed in pyutil over the years have
|
|
|
|
subsequently been obsoleted by new features added to the
|
|
|
|
Python language or its standard library, thus showing that
|
|
|
|
we're not alone in wanting tools like these.
|
|
|
|
'';
|
2021-07-17 21:14:59 +00:00
|
|
|
homepage = "https://github.com/tpltnt/pyutil";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-07-17 21:14:59 +00:00
|
|
|
maintainers = with maintainers; [ prusnak ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|