nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 150 lines 3.6 kB view raw
1{ 2 lib, 3 python3, 4 fetchFromGitHub, 5 runtimeShell, 6 installShellFiles, 7 testers, 8 pdm, 9}: 10 11let 12 python = python3.override { 13 self = python; 14 packageOverrides = _: super: { 15 resolvelib = super.resolvelib.overridePythonAttrs (old: rec { 16 version = "1.1.0"; 17 src = old.src.override { 18 tag = version; 19 hash = "sha256-UBdgFN+fvbjz+rp8+rog8FW2jwO/jCfUPV7UehJKiV8="; 20 }; 21 }); 22 # pdm requires ...... -> ghostscript-with-X which is AGPL only 23 matplotlib = super.matplotlib.override { enableTk = false; }; 24 # pdm requires ...... -> jbig2dec which is AGPL only 25 moto = super.moto.overridePythonAttrs (old: { 26 doCheck = false; 27 }); 28 }; 29 }; 30in 31python.pkgs.buildPythonApplication rec { 32 pname = "pdm"; 33 version = "2.26.6"; 34 pyproject = true; 35 36 src = fetchFromGitHub { 37 owner = "pdm-project"; 38 repo = "pdm"; 39 tag = version; 40 hash = "sha256-khgaI9ivwF6i2zlW57vQtBwQpk5mzYVCV4lMOio7ibw="; 41 }; 42 43 pythonRelaxDeps = [ "hishel" ]; 44 45 nativeBuildInputs = [ installShellFiles ]; 46 47 build-system = with python.pkgs; [ 48 pdm-backend 49 pdm-build-locked 50 ]; 51 52 dependencies = 53 with python.pkgs; 54 [ 55 blinker 56 dep-logic 57 filelock 58 findpython 59 hishel 60 httpx 61 installer 62 msgpack 63 packaging 64 pbs-installer 65 platformdirs 66 pyproject-hooks 67 python-dotenv 68 resolvelib 69 rich 70 shellingham 71 tomlkit 72 truststore 73 unearth 74 id 75 virtualenv 76 ] 77 ++ httpx.optional-dependencies.socks; 78 79 makeWrapperArgs = [ "--set PDM_CHECK_UPDATE 0" ]; 80 81 # Silence network warning during pypaInstallPhase 82 # by disabling latest version check 83 preInstall = '' 84 export PDM_CHECK_UPDATE=0 85 ''; 86 87 postInstall = '' 88 export PDM_LOG_DIR=/tmp/pdm/log 89 $out/bin/pdm completion bash >pdm.bash 90 $out/bin/pdm completion fish >pdm.fish 91 $out/bin/pdm completion zsh >pdm.zsh 92 installShellCompletion pdm.{bash,fish,zsh} 93 unset PDM_LOG_DIR 94 ''; 95 96 nativeCheckInputs = with python.pkgs; [ 97 first 98 pytestCheckHook 99 pytest-mock 100 pytest-xdist 101 pytest-httpserver 102 ]; 103 104 disabledTestMarks = [ "network" ]; 105 106 preCheck = '' 107 export HOME=$TMPDIR 108 substituteInPlace tests/cli/test_run.py \ 109 --replace-fail "/bin/bash" "${runtimeShell}" 110 ''; 111 112 disabledTests = [ 113 # fails to locate setuptools (maybe upstream bug) 114 "test_convert_setup_py_project" 115 # pythonfinder isn't aware of nix's python infrastructure 116 "test_use_wrapper_python" 117 "test_build_with_no_isolation" 118 "test_run_script_with_inline_metadata" 119 120 # touches the network 121 "test_find_candidates_from_find_links" 122 "test_lock_all_with_excluded_groups" 123 "test_find_interpreters_with_PDM_IGNORE_ACTIVE_VENV" 124 "test_build_distributions" 125 "test_init_project_respect" 126 "test_use_python_write_file_multiple_versions" 127 "test_repository_get_token_from_oidc" 128 "test_repository_get_token_misconfigured_github" 129 130 # https://github.com/pdm-project/pdm/issues/3590 131 "test_install_from_lock_with_higher_version" 132 ]; 133 134 __darwinAllowLocalNetworking = true; 135 136 passthru.tests.version = testers.testVersion { package = pdm; }; 137 138 meta = { 139 homepage = "https://pdm-project.org"; 140 changelog = "https://github.com/pdm-project/pdm/releases/tag/${version}"; 141 description = "Modern Python package and dependency manager supporting the latest PEP standards"; 142 license = lib.licenses.mit; 143 maintainers = with lib.maintainers; [ 144 cpcloud 145 natsukium 146 misilelab 147 ]; 148 mainProgram = "pdm"; 149 }; 150}