1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 hatchling,
7 packaging,
8 tomli,
9 pyyaml,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "dparse";
15 version = "0.6.4";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "pyupio";
22 repo = "dparse";
23 tag = version;
24 hash = "sha256-LnsmJtWLjV3xoSjacfR9sUwPlOjQTRBWirJVtIJSE8A=";
25 };
26
27 build-system = [ hatchling ];
28
29 dependencies = [ packaging ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
30
31 optional-dependencies = {
32 # FIXME pipenv = [ pipenv ];
33 conda = [ pyyaml ];
34 };
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 ] ++ lib.flatten (lib.attrValues optional-dependencies);
39
40 pythonImportsCheck = [ "dparse" ];
41
42 disabledTests = [
43 # requires unpackaged dependency pipenv
44 "test_update_pipfile"
45 ];
46
47 meta = with lib; {
48 description = "Parser for Python dependency files";
49 homepage = "https://github.com/pyupio/dparse";
50 changelog = "https://github.com/pyupio/dparse/blob/${version}/HISTORY.rst";
51 license = licenses.mit;
52 maintainers = with maintainers; [ thomasdesr ];
53 };
54}