diff --git a/pkgs/tools/package-management/poetry/default.nix b/pkgs/tools/package-management/poetry/default.nix index 7af4fb550b873..928023e0b41b7 100644 --- a/pkgs/tools/package-management/poetry/default.nix +++ b/pkgs/tools/package-management/poetry/default.nix @@ -1,6 +1,7 @@ { lib , python3 , fetchFromGitHub +, fetchPypi }: let @@ -22,37 +23,42 @@ let self.lockfile ]; }); - platformdirs = super.platformdirs.overridePythonAttrs (old: rec { - version = "2.6.2"; - src = fetchFromGitHub { - owner = "platformdirs"; - repo = "platformdirs"; - rev = "refs/tags/${version}"; - hash = "sha256-yGpDAwn8Kt6vF2K2zbAs8+fowhYQmvsm/87WJofuhME="; - }; - SETUPTOOLS_SCM_PRETEND_VERSION = version; - }); poetry-core = super.poetry-core.overridePythonAttrs (old: rec { - version = "1.5.2"; + version = "1.6.1"; src = fetchFromGitHub { owner = "python-poetry"; repo = "poetry-core"; rev = version; - hash = "sha256-GpZ0vMByHTu5kl7KrrFFK2aZMmkNO7xOEc8NI2H9k34="; + hash = "sha256-Gc22Y2T4uO39jiOqEUFeOfnVCbknuDjmzFPZgk2eY74="; + }; + nativeCheckInputs = old.nativeCheckInputs ++ [ + self.tomli-w + ]; + }); + virtualenv = super.virtualenv.overridePythonAttrs (old: rec { + version = "20.23.1"; + src = fetchPypi { + inherit (old) pname; + inherit version; + hash = "sha256-j/GaOMECHHQhSO3E+By0PX+MaBbS7eKrcq9bhMdJreE="; }; + nativeCheckInputs = old.nativeCheckInputs ++ [ + self.time-machine + ]; }); - }; + } // (plugins self); }; - plugins = with python.pkgs; { + plugins = ps: with ps; { poetry-audit-plugin = callPackage ./plugins/poetry-audit-plugin.nix { }; + poetry-plugin-export = callPackage ./plugins/poetry-plugin-export.nix { }; poetry-plugin-up = callPackage ./plugins/poetry-plugin-up.nix { }; }; # selector is a function mapping pythonPackages to a list of plugins # e.g. poetry.withPlugins (ps: with ps; [ poetry-plugin-up ]) withPlugins = selector: let - selected = selector plugins; + selected = selector (plugins python.pkgs); in python.pkgs.toPythonApplication (python.pkgs.poetry.overridePythonAttrs (old: { propagatedBuildInputs = old.propagatedBuildInputs ++ selected; @@ -65,8 +71,9 @@ let rm $out/nix-support/propagated-build-inputs ''; - passthru = rec { - inherit plugins withPlugins python; + passthru = { + plugins = plugins python.pkgs; + inherit withPlugins python; }; })); in withPlugins (ps: [ ]) diff --git a/pkgs/development/python-modules/poetry-plugin-export/default.nix b/pkgs/tools/package-management/poetry/plugins/poetry-plugin-export.nix similarity index 90% rename from pkgs/development/python-modules/poetry-plugin-export/default.nix rename to pkgs/tools/package-management/poetry/plugins/poetry-plugin-export.nix index d712dacff7cdc..24433f3601ebd 100644 --- a/pkgs/development/python-modules/poetry-plugin-export/default.nix +++ b/pkgs/tools/package-management/poetry/plugins/poetry-plugin-export.nix @@ -6,14 +6,14 @@ buildPythonPackage rec { pname = "poetry-plugin-export"; - version = "1.3.1"; + version = "1.4.0"; format = "pyproject"; src = fetchFromGitHub { owner = "python-poetry"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-zA5YHZ3/iVoNf2AKqkrKVDYJIoJh+FMwuoskWHutG5I="; + hash = "sha256-okI91Z9u5w7IHpPb9jL4Hb8+MkYJEF2qm0mqqCdyKbk="; }; postPatch = '' diff --git a/pkgs/tools/package-management/poetry/plugins/poetry-plugin-up.nix b/pkgs/tools/package-management/poetry/plugins/poetry-plugin-up.nix index 71b7b96c486d8..ab00788facc30 100644 --- a/pkgs/tools/package-management/poetry/plugins/poetry-plugin-up.nix +++ b/pkgs/tools/package-management/poetry/plugins/poetry-plugin-up.nix @@ -1,5 +1,6 @@ { lib , fetchFromGitHub +, fetchpatch , buildPythonPackage , poetry-core , pytestCheckHook @@ -19,6 +20,14 @@ buildPythonPackage rec { hash = "sha256-QDfXgLkwh5rfyNZv0S7+cq6ubldXsbuCiTr6VYx8ZQs="; }; + patches = [ + # https://github.com/MousaZeidBaker/poetry-plugin-up/pull/24 + (fetchpatch { + url = "https://github.com/MousaZeidBaker/poetry-plugin-up/commit/31d78c547896efd27c2be0956a982638f32b07f8.patch"; + hash = "sha256-CkZgX/ES+VkfxBofxWeparXNjsdP4qcQ1I32zaBBmWo="; + }) + ]; + nativeBuildInputs = [ poetry-core ]; diff --git a/pkgs/tools/package-management/poetry/unwrapped.nix b/pkgs/tools/package-management/poetry/unwrapped.nix index 550a8335e26c3..839b1882aa056 100644 --- a/pkgs/tools/package-management/poetry/unwrapped.nix +++ b/pkgs/tools/package-management/poetry/unwrapped.nix @@ -44,7 +44,7 @@ buildPythonPackage rec { pname = "poetry"; - version = "1.4.2"; + version = "1.5.1"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -53,7 +53,7 @@ buildPythonPackage rec { owner = "python-poetry"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-AiRQFZA5+M1niTzj1RO2lx0QFOMmSzpQo1gzauyTblg="; + hash = "sha256-1zqfGzSI5RDACSNcz0tLA4VKMFwE5uD/YqOkgpzg2nQ="; }; nativeBuildInputs = [ @@ -123,6 +123,7 @@ buildPythonPackage rec { ''; disabledTests = [ + "test_installer_with_pypi_repository" # touches network "git" "solver" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 108029471b6cf..7ea8e419350d0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8103,8 +8103,6 @@ self: super: with self; { poetry-dynamic-versioning = callPackage ../development/python-modules/poetry-dynamic-versioning { }; - poetry-plugin-export = callPackage ../development/python-modules/poetry-plugin-export { }; - poetry-semver = callPackage ../development/python-modules/poetry-semver { }; poezio = callPackage ../applications/networking/instant-messengers/poezio { };