1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, flit-core
6, filelock
7, packaging
8, pyproject-hooks
9, pytest-mock
10, pytest-rerunfailures
11, pytest-xdist
12, pytestCheckHook
13, pythonOlder
14, setuptools
15, toml
16, tomli
17}:
18
19buildPythonPackage rec {
20 pname = "build";
21 version = "0.10.0";
22 format = "pyproject";
23
24 disabled = pythonOlder "3.6";
25
26 src = fetchFromGitHub {
27 owner = "pypa";
28 repo = pname;
29 rev = version;
30 hash = "sha256-kXFrfTb7+68EV+gSENL81IFSR+ue7Fl6R2gsuFFBJhI=";
31 };
32
33 nativeBuildInputs = [
34 flit-core
35 ];
36
37 propagatedBuildInputs = [
38 packaging
39 pyproject-hooks
40 ] ++ lib.optionals (pythonOlder "3.11") [
41 tomli
42 ];
43
44 nativeCheckInputs = [
45 filelock
46 pytest-mock
47 pytest-rerunfailures
48 pytest-xdist
49 pytestCheckHook
50 setuptools
51 toml
52 ];
53
54 pytestFlagsArray = [
55 "-W"
56 "ignore::DeprecationWarning"
57 ];
58
59 __darwinAllowLocalNetworking = true;
60
61 disabledTests = [
62 # Tests often fail with StopIteration
63 "test_isolat"
64 "test_default_pip_is_never_too_old"
65 "test_build"
66 "test_with_get_requires"
67 "test_init"
68 "test_output"
69 "test_wheel_metadata"
70 ] ++ lib.optionals stdenv.isDarwin [
71 # Expects Apple's Python and its quirks
72 "test_can_get_venv_paths_with_conflicting_default_scheme"
73 ];
74
75 pythonImportsCheck = [
76 "build"
77 ];
78
79 meta = with lib; {
80 mainProgram = "pyproject-build";
81 description = "Simple, correct PEP517 package builder";
82 longDescription = ''
83 build will invoke the PEP 517 hooks to build a distribution package. It
84 is a simple build tool and does not perform any dependency management.
85 '';
86 homepage = "https://github.com/pypa/build";
87 changelog = "https://github.com/pypa/build/blob/${version}/CHANGELOG.rst";
88 license = licenses.mit;
89 maintainers = with maintainers; [ fab ];
90 };
91}