1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 loguru,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10 typing-extensions,
11}:
12
13buildPythonPackage rec {
14 pname = "python-utils";
15 version = "3.9.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "WoLpH";
22 repo = "python-utils";
23 tag = "v${version}";
24 hash = "sha256-lzLzYI5jShfIwQqvfA8UtPjGawXE80ww7jb/gPzpeDo=";
25 };
26
27 postPatch = ''
28 sed -i pytest.ini \
29 -e '/--cov/d' \
30 -e '/--mypy/d'
31 '';
32
33 build-system = [ setuptools ];
34
35 dependencies = [ typing-extensions ];
36
37 optional-dependencies = {
38 loguru = [ loguru ];
39 };
40
41 nativeCheckInputs = [
42 pytest-asyncio
43 pytestCheckHook
44 ]
45 ++ optional-dependencies.loguru;
46
47 pythonImportsCheck = [ "python_utils" ];
48
49 enabledTestPaths = [ "_python_utils_tests" ];
50
51 disabledTests = [
52 # Flaky tests
53 "test_timeout_generator"
54 ];
55
56 meta = with lib; {
57 description = "Module with some convenient utilities";
58 homepage = "https://github.com/WoLpH/python-utils";
59 changelog = "https://github.com/wolph/python-utils/releases/tag/v${version}";
60 license = licenses.bsd3;
61 maintainers = [ ];
62 };
63}