Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions pkgs/tools/package-management/poetry/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, python3
, fetchFromGitHub
, fetchPypi
}:

let
Expand All @@ -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;

Expand All @@ -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: [ ])
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, fetchFromGitHub
, fetchpatch
, buildPythonPackage
, poetry-core
, pytestCheckHook
Expand All @@ -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
];
Expand Down
5 changes: 3 additions & 2 deletions pkgs/tools/package-management/poetry/unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

buildPythonPackage rec {
pname = "poetry";
version = "1.4.2";
version = "1.5.1";
format = "pyproject";

disabled = pythonOlder "3.7";
Expand All @@ -53,7 +53,7 @@ buildPythonPackage rec {
owner = "python-poetry";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-AiRQFZA5+M1niTzj1RO2lx0QFOMmSzpQo1gzauyTblg=";
hash = "sha256-1zqfGzSI5RDACSNcz0tLA4VKMFwE5uD/YqOkgpzg2nQ=";
};

nativeBuildInputs = [
Expand Down Expand Up @@ -123,6 +123,7 @@ buildPythonPackage rec {
'';

disabledTests = [
"test_installer_with_pypi_repository"
# touches network
"git"
"solver"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down