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