2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchpatch
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchPypi
|
|
|
|
, nix-update-script
|
2023-10-09 19:29:22 +00:00
|
|
|
, runtimeShell
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
2022-02-10 20:34:41 +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: {
|
2023-08-04 22:07:22 +00:00
|
|
|
resolvelib = super.resolvelib.overridePythonAttrs rec {
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "1.0.1";
|
2022-02-10 20:34:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sarugaku";
|
|
|
|
repo = "resolvelib";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "/refs/tags/${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-oxyPn3aFPOyx/2aP7Eg2ThtPbyzrFT1JzWqy6GqNbzM=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
self = python;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
with python.pkgs;
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "pdm";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.10.4";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-bf2dTLWQQ+3sstC0fSCOVdidMzunGX3rBcyi37x6S/s=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [
|
2023-04-29 16:46:19 +00:00
|
|
|
pdm-backend
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
blinker
|
2022-09-30 11:47:45 +00:00
|
|
|
certifi
|
2023-08-04 22:07:22 +00:00
|
|
|
cachecontrol
|
2022-04-15 01:41:22 +00:00
|
|
|
findpython
|
2022-02-10 20:34:41 +00:00
|
|
|
installer
|
|
|
|
packaging
|
|
|
|
platformdirs
|
2023-01-20 10:41:00 +00:00
|
|
|
pyproject-hooks
|
2022-02-10 20:34:41 +00:00
|
|
|
python-dotenv
|
2022-09-30 11:47:45 +00:00
|
|
|
requests-toolbelt
|
2022-02-10 20:34:41 +00:00
|
|
|
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
|
|
|
|
]
|
|
|
|
++ cachecontrol.optional-dependencies.filecache
|
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
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
2023-02-22 10:55:15 +00:00
|
|
|
pytest-rerunfailures
|
2022-02-10 20:34:41 +00:00
|
|
|
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 \
|
|
|
|
--replace "/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"
|
2022-09-30 11:47:45 +00:00
|
|
|
"test_use_invalid_wrapper_python"
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
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}";
|
2022-02-10 20:34:41 +00:00
|
|
|
description = "A modern Python package manager with PEP 582 support";
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|