1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6
7 # propagates
8 importlib-metadata,
9
10 # tests
11 editables,
12 git,
13 mercurial,
14 pytestCheckHook,
15 setuptools,
16}:
17
18buildPythonPackage rec {
19 pname = "pdm-backend";
20 version = "2.3.0";
21 format = "pyproject";
22
23 src = fetchFromGitHub {
24 owner = "pdm-project";
25 repo = "pdm-backend";
26 rev = "refs/tags/${version}";
27 hash = "sha256-V+NESf7NavR6L6ko4Oh4KhAR2iIN5GiHZPELwvkpr4c=";
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 git
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.email nixbld@localhost
50 '';
51
52 setupHook = ./setup-hook.sh;
53
54 meta = with lib; {
55 homepage = "https://github.com/pdm-project/pdm-backend";
56 changelog = "https://github.com/pdm-project/pdm-backend/releases/tag/${version}";
57 description = "Yet another PEP 517 backend.";
58 license = licenses.mit;
59 maintainers = with maintainers; [ hexa ];
60 };
61}