1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6
7 # propagates
8 importlib-metadata,
9
10 # tests
11 editables,
12 gitMinimal,
13 mercurial,
14 pytestCheckHook,
15 setuptools,
16}:
17
18buildPythonPackage rec {
19 pname = "pdm-backend";
20 version = "2.4.5";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "pdm-project";
25 repo = "pdm-backend";
26 tag = version;
27 hash = "sha256-tXgojVE/Bh2OVeMG/P5aCK5HEeUhiypUjTrS4yOwvZU=";
28 };
29
30 env.PDM_BUILD_SCM_VERSION = version;
31
32 dependencies = lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
33
34 pythonImportsCheck = [ "pdm.backend" ];
35
36 nativeCheckInputs = [
37 editables
38 gitMinimal
39 mercurial
40 pytestCheckHook
41 setuptools
42 ];
43
44 preCheck = ''
45 unset PDM_BUILD_SCM_VERSION
46
47 # tests require a configured git identity
48 export HOME=$TMPDIR
49 git config --global user.name nixbld
50 git config --global user.email nixbld@localhost
51 '';
52
53 setupHook = ./setup-hook.sh;
54
55 meta = with lib; {
56 homepage = "https://github.com/pdm-project/pdm-backend";
57 changelog = "https://github.com/pdm-project/pdm-backend/releases/tag/${version}";
58 description = "Yet another PEP 517 backend";
59 license = licenses.mit;
60 maintainers = with maintainers; [ hexa ];
61 };
62}