2021-04-26 19:14:03 +00:00
|
|
|
{ lib
|
2023-02-16 17:41:37 +00:00
|
|
|
, stdenv
|
2021-04-26 19:14:03 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-07-14 12:49:19 +00:00
|
|
|
, loguru
|
2022-11-02 22:02:43 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
, typing-extensions
|
2021-04-26 19:14:03 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-utils";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.8.1";
|
2022-11-02 22:02:43 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WoLpH";
|
|
|
|
repo = pname;
|
2022-11-02 22:02:43 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-HoKdMDs67lsuVRb5d51wx6qyEjEM973yD6O6qMO+7MI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
sed -i pytest.ini \
|
|
|
|
-e '/--cov/d' \
|
|
|
|
-e '/--mypy/d'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
loguru = [
|
|
|
|
loguru
|
|
|
|
];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-02 22:02:43 +00:00
|
|
|
pytest-asyncio
|
2021-04-26 19:14:03 +00:00
|
|
|
pytestCheckHook
|
2022-11-02 22:02:43 +00:00
|
|
|
] ++ passthru.optional-dependencies.loguru;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"python_utils"
|
2021-04-26 19:14:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"_python_utils_tests"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# Flaky tests on darwin
|
|
|
|
"test_timeout_generator"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Module with some convenient utilities";
|
|
|
|
homepage = "https://github.com/WoLpH/python-utils";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/wolph/python-utils/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2022-11-02 22:02:43 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|