1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 fetchpatch2,
7 setuptools,
8 packaging,
9 tomli,
10 pyyaml,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "dparse";
16 version = "0.6.3";
17 pyproject = true;
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-J7uLS8rv7DmXaXuj9uBrJEcgC6JzwLCFw9ASoEVxtSg=";
24 };
25
26 patches = [
27 (fetchpatch2 {
28 name = "fix-configparser-deprecation-warning.patch";
29 url = "https://github.com/pyupio/dparse/pull/69.patch";
30 hash = "sha256-RolD6xDJpI8/UHgAdcsXoyxOGLok7AogLMOTl1ZPKvw=";
31 })
32 ];
33
34 nativeBuildInputs = [ setuptools ];
35
36 propagatedBuildInputs = [ packaging ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
37
38 passthru.optional-dependencies = {
39 # FIXME pipenv = [ pipenv ];
40 conda = [ pyyaml ];
41 };
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
46
47 pythonImportsCheck = [ "dparse" ];
48
49 disabledTests = [
50 # requires unpackaged dependency pipenv
51 "test_update_pipfile"
52 ];
53
54 meta = with lib; {
55 description = "A parser for Python dependency files";
56 homepage = "https://github.com/pyupio/dparse";
57 changelog = "https://github.com/pyupio/dparse/blob/${version}/HISTORY.rst";
58 license = licenses.mit;
59 maintainers = with maintainers; [ thomasdesr ];
60 };
61}