depot/third_party/nixpkgs/pkgs/development/python-modules/pdm-backend/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

61 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
# propagates
importlib-metadata,
# tests
editables,
git,
mercurial,
pytestCheckHook,
setuptools,
}:
buildPythonPackage rec {
pname = "pdm-backend";
version = "2.3.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "pdm-project";
repo = "pdm-backend";
rev = "refs/tags/${version}";
hash = "sha256-I1bAjryLDXzlstIHK4cD6/HPJBGGskRUVp7B2PDwXhc=";
};
env.PDM_BUILD_SCM_VERSION = version;
dependencies = lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
pythonImportsCheck = [ "pdm.backend" ];
nativeCheckInputs = [
editables
git
mercurial
pytestCheckHook
setuptools
];
preCheck = ''
unset PDM_BUILD_SCM_VERSION
# tests require a configured git identity
export HOME=$TMPDIR
git config --global user.email nixbld@localhost
'';
setupHook = ./setup-hook.sh;
meta = with lib; {
homepage = "https://github.com/pdm-project/pdm-backend";
changelog = "https://github.com/pdm-project/pdm-backend/releases/tag/${version}";
description = "Yet another PEP 517 backend";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
}