1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build time
7, hatchling
8, hatch-vcs
9, setuptools-scm
10
11# runtime
12, packaging
13, toml
14, tomli
15
16# docs
17, sphinxHook
18, furo
19, sphinx-autodoc-typehints
20
21# tests
22, pytest-mock
23, pytestCheckHook
24, virtualenv
25, wheel
26}:
27
28buildPythonPackage rec {
29 pname = "pyproject-api";
30 version = "1.5.0";
31 format = "pyproject";
32
33 disabled = pythonOlder "3.8";
34
35 src = fetchFromGitHub {
36 owner = "tox-dev";
37 repo = "pyproject-api";
38 rev = "refs/tags/${version}";
39 hash = "sha256-VO+huA9i7uMpCVaWHC29XlfestSu+N9vWWHteY21uqs=";
40 };
41
42 outputs = [
43 "out"
44 "doc"
45 ];
46
47 SETUPTOOLS_SCM_PRETEND_VERSION = version;
48
49 nativeBuildInputs = [
50 hatchling
51 hatch-vcs
52 setuptools-scm
53
54 # docs
55 sphinxHook
56 furo
57 sphinx-autodoc-typehints
58 ];
59
60 propagatedBuildInputs = [
61 packaging
62 ] ++ lib.optionals (pythonOlder "3.11") [
63 tomli
64 ];
65
66 nativeCheckInputs = [
67 pytest-mock
68 pytestCheckHook
69 virtualenv
70 wheel
71 ];
72
73 disabledTests = [
74 # requires eol python2 interpreter
75 "test_can_build_on_python_2"
76 ];
77
78 pythonImportsCheck = [
79 "pyproject_api"
80 ];
81
82 meta = with lib; {
83 changelog = "https://github.com/tox-dev/pyproject-api/releases/tag/${version}";
84 description = "API to interact with the python pyproject.toml based projects";
85 homepage = "https://github.com/tox-dev/pyproject-api";
86 license = licenses.mit;
87 maintainers = with maintainers; [ ];
88 };
89}