diff --git a/pkgs/development/python-modules/pdm-build-locked/default.nix b/pkgs/development/python-modules/pdm-build-locked/default.nix new file mode 100644 index 000000000000..9c8026d32d21 --- /dev/null +++ b/pkgs/development/python-modules/pdm-build-locked/default.nix @@ -0,0 +1,57 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + pdm-backend, + tomli, + build, + hatchling, + pkginfo, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "pdm-build-locked"; + version = "0.3.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pdm-project"; + repo = "pdm-build-locked"; + rev = "refs/tags/${version}"; + hash = "sha256-tgLC1tUgmyX7QvlLpNb/SMQRTDZ+DNFV3o0JELAZEeo="; + }; + + postPatch = '' + substituteInPlace tests/conftest.py \ + --replace-fail '"pdm.pytest"' "" + sed -i "/addopts/d" pyproject.toml + ''; + + build-system = [ pdm-backend ]; + + dependencies = lib.optionals (pythonOlder "3.11") [ tomli ]; + + pythonImportsCheck = [ "pdm_build_locked" ]; + + nativeCheckInputs = [ + build + hatchling + pkginfo + pytestCheckHook + ]; + + disabledTestPaths = [ + # circular import of pdm + "tests/unit/test_build_command.py" + ]; + + meta = { + description = "Pdm-build-locked is a pdm plugin to publish locked dependencies as optional-dependencies"; + homepage = "https://github.com/pdm-project/pdm-build-locked"; + changelog = "https://github.com/pdm-project/pdm-build-locked/releases/tag/${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/tools/package-management/pdm/default.nix b/pkgs/tools/package-management/pdm/default.nix index 2fab674ec13d..347a78b9af85 100644 --- a/pkgs/tools/package-management/pdm/default.nix +++ b/pkgs/tools/package-management/pdm/default.nix @@ -11,14 +11,14 @@ with python3.pkgs; buildPythonApplication rec { pname = "pdm"; - version = "2.15.4"; + version = "2.17.3"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-WOIlhQVn3K3OQkGNtGOJlt8rE3jNCDDNSK/aG0VdnHI="; + hash = "sha256-9JIg8iXscSWMv3FIsUp2yurGEnRb7atn+QYjmOpWp6U="; }; nativeBuildInputs = [ @@ -27,6 +27,7 @@ buildPythonApplication rec { build-system = [ pdm-backend + pdm-build-locked ]; dependencies = [ @@ -102,11 +103,14 @@ buildPythonApplication rec { "test_convert_setup_py_project" # pythonfinder isn't aware of nix's python infrastructure "test_use_wrapper_python" + "test_build_with_no_isolation" + "test_run_script_with_inline_metadata" # touches the network "test_find_candidates_from_find_links" "test_lock_all_with_excluded_groups" "test_find_interpreters_with_PDM_IGNORE_ACTIVE_VENV" + "test_build_distributions" ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 553c1020ca20..5cf89a3bb6fa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9898,6 +9898,8 @@ self: super: with self; { pdm-backend = callPackage ../development/python-modules/pdm-backend { }; + pdm-build-locked = callPackage ../development/python-modules/pdm-build-locked { }; + pdm-pep517 = callPackage ../development/python-modules/pdm-pep517 { }; pdoc = callPackage ../development/python-modules/pdoc { };