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