2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchPypi
|
|
|
|
, nix-update-script
|
2023-10-09 19:29:22 +00:00
|
|
|
, runtimeShell
|
2024-02-29 20:09:43 +00:00
|
|
|
, installShellFiles
|
|
|
|
, testers
|
|
|
|
, pdm
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
with python3.pkgs;
|
2022-02-10 20:34:41 +00:00
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "pdm";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.15.1";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-HJzQScEBZjOiPvkuwfx4LaiuB0MULvM/r31Ihy+HSzk=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [
|
2024-02-29 20:09:43 +00:00
|
|
|
installShellFiles
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
|
|
|
pdm-backend
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies = [
|
2022-02-10 20:34:41 +00:00
|
|
|
blinker
|
2024-01-25 14:12:00 +00:00
|
|
|
dep-logic
|
2024-04-21 15:54:59 +00:00
|
|
|
filelock
|
2022-04-15 01:41:22 +00:00
|
|
|
findpython
|
2024-04-21 15:54:59 +00:00
|
|
|
hishel
|
|
|
|
httpx
|
2022-02-10 20:34:41 +00:00
|
|
|
installer
|
2024-04-21 15:54:59 +00:00
|
|
|
msgpack
|
2022-02-10 20:34:41 +00:00
|
|
|
packaging
|
2024-04-21 15:54:59 +00:00
|
|
|
pbs-installer
|
2022-02-10 20:34:41 +00:00
|
|
|
platformdirs
|
2023-01-20 10:41:00 +00:00
|
|
|
pyproject-hooks
|
2022-02-10 20:34:41 +00:00
|
|
|
python-dotenv
|
|
|
|
resolvelib
|
2022-09-30 11:47:45 +00:00
|
|
|
rich
|
2022-02-10 20:34:41 +00:00
|
|
|
shellingham
|
|
|
|
tomlkit
|
2022-09-30 11:47:45 +00:00
|
|
|
unearth
|
|
|
|
virtualenv
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ httpx.optional-dependencies.socks
|
|
|
|
++ pbs-installer.optional-dependencies.install
|
2023-02-22 10:55:15 +00:00
|
|
|
++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.10") [
|
2022-02-10 20:34:41 +00:00
|
|
|
importlib-metadata
|
2024-01-25 14:12:00 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
truststore
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
"--set PDM_CHECK_UPDATE 0"
|
|
|
|
];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
# Silence network warning during pypaInstallPhase
|
|
|
|
# by disabling latest version check
|
|
|
|
export PDM_CHECK_UPDATE=0
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
export PDM_LOG_DIR=/tmp/pdm/log
|
|
|
|
$out/bin/pdm completion bash >pdm.bash
|
|
|
|
$out/bin/pdm completion fish >pdm.fish
|
|
|
|
$out/bin/pdm completion zsh >pdm.zsh
|
|
|
|
installShellCompletion pdm.{bash,fish,zsh}
|
|
|
|
unset PDM_LOG_DIR
|
2024-02-29 20:09:43 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-xdist
|
2023-05-24 13:37:59 +00:00
|
|
|
pytest-httpserver
|
2023-08-04 22:07:22 +00:00
|
|
|
] ++ lib.optional stdenv.isLinux first;
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"-m 'not network'"
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace tests/cli/test_run.py \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-warn "/bin/bash" "${runtimeShell}"
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
2022-09-30 11:47:45 +00:00
|
|
|
# fails to locate setuptools (maybe upstream bug)
|
|
|
|
"test_convert_setup_py_project"
|
2022-02-10 20:34:41 +00:00
|
|
|
# pythonfinder isn't aware of nix's python infrastructure
|
|
|
|
"test_use_wrapper_python"
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# touches the network
|
|
|
|
"test_find_candidates_from_find_links"
|
2024-05-15 15:35:15 +00:00
|
|
|
"test_lock_all_with_excluded_groups"
|
|
|
|
"test_find_interpreters_with_PDM_IGNORE_ACTIVE_VENV"
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = pdm;
|
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
meta = with lib; {
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://pdm-project.org";
|
2023-02-22 10:55:15 +00:00
|
|
|
changelog = "https://github.com/pdm-project/pdm/releases/tag/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "A modern Python package and dependency manager supporting the latest PEP standards";
|
2022-02-10 20:34:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "pdm";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
}
|