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 ]
39 ++ lib.flatten (lib.attrValues optional-dependencies);
40
41 pythonImportsCheck = [ "dparse" ];
42
43 disabledTests = [
44 # requires unpackaged dependency pipenv
45 "test_update_pipfile"
46 ];
47
48 meta = with lib; {
49 description = "Parser for Python dependency files";
50 homepage = "https://github.com/pyupio/dparse";
51 changelog = "https://github.com/pyupio/dparse/blob/${version}/HISTORY.rst";
52 license = licenses.mit;
53 maintainers = with maintainers; [ thomasdesr ];
54 };
55}