Files
nixpkgs/pkgs/development/python-modules/pdm-backend/default.nix
T
Emily 3d69d78a6c python3{11,12}Packages.pdm-backend: set Git user.name for tests
At least one Hydra Darwin builder has an empty real name field for
at least one Nix build user, which causes Git to infer an empty
`user.name` and break.
2024-10-03 20:03:12 +01:00

63 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.3";
pyproject = true;
src = fetchFromGitHub {
owner = "pdm-project";
repo = "pdm-backend";
rev = "refs/tags/${version}";
hash = "sha256-gM8Sx6nMiq84e3sLJn35shF2jy6Ce1qPlERi2XpS89k=";
};
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.name nixbld
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 ];
};
}