2020-06-15 15:56:04 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, stdenv
|
2023-10-09 19:29:22 +00:00
|
|
|
, build
|
2020-06-15 15:56:04 +00:00
|
|
|
, buildPythonPackage
|
2021-07-17 21:14:59 +00:00
|
|
|
, fetchFromGitHub
|
2023-03-15 16:39:30 +00:00
|
|
|
, flit-core
|
2021-03-19 17:17:44 +00:00
|
|
|
, filelock
|
|
|
|
, packaging
|
2023-03-15 16:39:30 +00:00
|
|
|
, pyproject-hooks
|
2021-03-19 17:17:44 +00:00
|
|
|
, pytest-mock
|
2021-07-17 21:14:59 +00:00
|
|
|
, pytest-rerunfailures
|
2021-03-19 17:17:44 +00:00
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
2020-06-15 15:56:04 +00:00
|
|
|
, pythonOlder
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2021-12-19 01:06:50 +00:00
|
|
|
, tomli
|
2023-11-16 04:20:00 +00:00
|
|
|
, wheel
|
2020-06-15 15:56:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "build";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.1.1";
|
2020-06-15 15:56:04 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2021-07-17 21:14:59 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pypa";
|
2023-11-16 04:20:00 +00:00
|
|
|
repo = "build";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-SGWpm+AGIfqKMpDfmz2aMYmcs+XVREbHIXSuU4R7U/k=";
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
# not strictly required, causes circular dependency cycle
|
|
|
|
sed -i '/importlib-metadata >= 4.6/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
nativeBuildInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
flit-core
|
2020-06-15 15:56:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
packaging
|
2023-03-15 16:39:30 +00:00
|
|
|
pyproject-hooks
|
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
2021-12-19 01:06:50 +00:00
|
|
|
tomli
|
2020-06-15 15:56:04 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# We need to disable tests because this package is part of the bootstrap chain
|
|
|
|
# and its test dependencies cannot be built yet when this is being built.
|
|
|
|
doCheck = false;
|
2021-03-19 17:17:44 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.tests = {
|
|
|
|
pytest = buildPythonPackage {
|
|
|
|
pname = "${pname}-pytest";
|
2023-11-16 04:20:00 +00:00
|
|
|
inherit src version;
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "other";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontInstall = true;
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
build
|
|
|
|
filelock
|
|
|
|
pytest-mock
|
|
|
|
pytest-rerunfailures
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
setuptools
|
2023-11-16 04:20:00 +00:00
|
|
|
wheel
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests often fail with StopIteration
|
|
|
|
"test_isolat"
|
|
|
|
"test_default_pip_is_never_too_old"
|
|
|
|
"test_build"
|
|
|
|
"test_with_get_requires"
|
|
|
|
"test_init"
|
|
|
|
"test_output"
|
|
|
|
"test_wheel_metadata"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# Expects Apple's Python and its quirks
|
|
|
|
"test_can_get_venv_paths_with_conflicting_default_scheme"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2021-03-19 17:17:44 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"build"
|
|
|
|
];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2023-05-24 13:37:59 +00:00
|
|
|
mainProgram = "pyproject-build";
|
2021-02-05 17:12:51 +00:00
|
|
|
description = "Simple, correct PEP517 package builder";
|
|
|
|
longDescription = ''
|
|
|
|
build will invoke the PEP 517 hooks to build a distribution package. It
|
|
|
|
is a simple build tool and does not perform any dependency management.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/pypa/build";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/pypa/build/blob/${version}/CHANGELOG.rst";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.mit;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = teams.python.members ++ [ maintainers.fab ];
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
}
|