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