1{ lib 2, buildPythonPackage 3, fetchPypi 4, flit-core 5, pyproject-hooks 6, pytestCheckHook 7, pythonOlder 8, setuptools 9, testpath 10, tomli 11}: 12 13buildPythonPackage rec { 14 pname = "pyproject-hooks"; 15 version = "1.0.0"; 16 format = "pyproject"; 17 18 disabled = pythonOlder "3.7"; 19 20 src = fetchPypi rec { 21 pname = "pyproject_hooks"; 22 inherit version; 23 hash = "sha256-8nGymLl/WVXVP7ErcsH7GUjCLBprcLMVxUztrKAmTvU="; 24 }; 25 26 nativeBuildInputs = [ 27 flit-core 28 ]; 29 30 propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ 31 tomli 32 ]; 33 34 # We need to disable tests because this package is part of the bootstrap chain 35 # and its test dependencies cannot be built yet when this is being built. 36 doCheck = false; 37 38 passthru.tests = { 39 pytest = buildPythonPackage { 40 pname = "${pname}-pytest"; 41 inherit version; 42 format = "other"; 43 44 dontBuild = true; 45 dontInstall = true; 46 47 nativeCheckInputs = [ 48 pyproject-hooks 49 pytestCheckHook 50 setuptools 51 testpath 52 ]; 53 54 disabledTests = [ 55 # fail to import setuptools 56 "test_setup_py" 57 "test_issue_104" 58 ]; 59 }; 60 }; 61 62 pythonImportsCheck = [ 63 "pyproject_hooks" 64 ]; 65 66 meta = with lib; { 67 description = "Low-level library for calling build-backends in `pyproject.toml`-based project "; 68 homepage = "https://github.com/pypa/pyproject-hooks"; 69 changelog = "https://github.com/pypa/pyproject-hooks/blob/v${version}/docs/changelog.rst"; 70 license = licenses.mit; 71 maintainers = teams.python.members; 72 }; 73}