nixpkgs/pkgs/tools/package-management/pdm/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.3 KiB
Nix
Raw Normal View History

2022-01-21 21:19:13 +00:00
{ lib, python3, fetchFromGitHub, fetchurl }:
2022-01-12 11:16:53 +00:00
let
python = python3.override {
# override resolvelib due to
# 1. pdm requiring a later version of resolvelib
# 2. Ansible being packaged as a library
# 3. Ansible being unable to upgrade to a later version of resolvelib
# see here for more details: https://github.com/NixOS/nixpkgs/pull/155380/files#r786255738
packageOverrides = self: super: {
resolvelib = super.resolvelib.overridePythonAttrs (attrs: rec {
version = "0.9.0";
2022-01-12 11:16:53 +00:00
src = fetchFromGitHub {
owner = "sarugaku";
repo = "resolvelib";
rev = "/refs/tags/${version}";
hash = "sha256-xzu8sMNMihJ80vezMdGkOT5Etx08qy3T/TkEn5EAY48=";
2022-01-12 11:16:53 +00:00
};
});
};
self = python;
};
in
with python.pkgs;
buildPythonApplication rec {
pname = "pdm";
version = "2.4.6";
2022-01-12 11:16:53 +00:00
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-g+fQxq2kwhNXXEJG2n5n4f9GMkmmLsjpHoay152fcVQ=";
2022-01-12 11:16:53 +00:00
};
nativeBuildInputs = [
pdm-pep517
];
2022-01-12 11:16:53 +00:00
propagatedBuildInputs = [
blinker
cachecontrol
certifi
findpython
2022-01-12 11:16:53 +00:00
installer
packaging
platformdirs
pyproject-hooks
2022-01-12 11:16:53 +00:00
python-dotenv
requests-toolbelt
2022-01-12 11:16:53 +00:00
resolvelib
rich
2022-01-12 11:16:53 +00:00
shellingham
tomlkit
unearth
virtualenv
]
++ cachecontrol.optional-dependencies.filecache
++ lib.optionals (pythonOlder "3.11") [
tomli
]
++ lib.optionals (pythonOlder "3.10") [
2022-01-12 11:16:53 +00:00
importlib-metadata
];
nativeCheckInputs = [
2022-01-12 11:16:53 +00:00
pytestCheckHook
pytest-mock
pytest-rerunfailures
2022-01-21 21:19:13 +00:00
pytest-xdist
];
pytestFlagsArray = [
"-m 'not network'"
2022-01-12 11:16:53 +00:00
];
preCheck = ''
export HOME=$TMPDIR
'';
2022-01-12 11:16:53 +00:00
disabledTests = [
# fails to locate setuptools (maybe upstream bug)
"test_convert_setup_py_project"
2022-01-12 11:16:53 +00:00
# pythonfinder isn't aware of nix's python infrastructure
"test_use_wrapper_python"
"test_use_invalid_wrapper_python"
2022-01-12 11:16:53 +00:00
];
__darwinAllowLocalNetworking = true;
2022-01-12 11:16:53 +00:00
meta = with lib; {
homepage = "https://pdm.fming.dev";
changelog = "https://github.com/pdm-project/pdm/releases/tag/${version}";
2022-01-12 11:16:53 +00:00
description = "A modern Python package manager with PEP 582 support";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}