Skip to content
Closed
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
47 changes: 41 additions & 6 deletions pkgs/tools/package-management/poetry/default.nix
Original file line number Diff line number Diff line change
@@ -1,39 +1,74 @@
{ lib
, python3
, fetchFromGitHub
, fetchPypi
}:

let
python = python3.override {
packageOverrides = self: super: {
poetry = self.callPackage ./unwrapped.nix { };

filelock = super.filelock.overridePythonAttrs (old: rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not be needed with #242402

version = "3.12.2";
src = fetchPypi {
inherit (old) pname;
inherit version;
hash = "sha256-ACdAUY2KpZomsMduEPuMbhXq6CXTS2/fZwMz/XuTjYE=";
};
nativeCheckInputs = with self; [
pytest-mock
pytestCheckHook
];
});
# version overrides required by poetry and its plugins
platformdirs = super.platformdirs.overridePythonAttrs (old: rec {
version = "2.6.2";
version = "3.8.0";
src = fetchFromGitHub {
owner = "platformdirs";
repo = "platformdirs";
rev = "refs/tags/${version}";
hash = "sha256-yGpDAwn8Kt6vF2K2zbAs8+fowhYQmvsm/87WJofuhME=";
hash = "sha256-eQAEHl61aC/B44G3zBqMjDVAQF8GerpJbeQ1nT4uQ4Q=";
};
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
];
});
poetry-plugin-export = super.poetry-plugin-export.overridePythonAttrs(old: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poetry-plugin-export should be removed from python3Packages.

version = "1.4.0";
src = fetchFromGitHub {
owner = "python-poetry";
repo = old.pname;
rev = "refs/tags/${old.version}";
hash = "sha256-okI91Z9u5w7IHpPb9jL4Hb8+MkYJEF2qm0mqqCdyKbk=";
};
});
};
};

plugins = with python.pkgs; {
poetry-audit-plugin = callPackage ./plugins/poetry-audit-plugin.nix { };
poetry-plugin-up = callPackage ./plugins/poetry-plugin-up.nix { };
};

# selector is a function mapping pythonPackages to a list of plugins
Expand All @@ -52,7 +87,7 @@ let
rm $out/nix-support/propagated-build-inputs
'';

passthru = rec {
passthru = {
inherit plugins withPlugins python;
};
}));
Expand Down
43 changes: 0 additions & 43 deletions pkgs/tools/package-management/poetry/plugins/poetry-plugin-up.nix

This file was deleted.

7 changes: 4 additions & 3 deletions pkgs/tools/package-management/poetry/unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
, requests
, requests-toolbelt
, shellingham
, tomlkit
, trove-classifiers
, urllib3
, virtualenv
, xattr
, tomlkit
, tomli
, importlib-metadata
, cachy
Expand All @@ -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 @@ -141,6 +141,7 @@ buildPythonPackage rec {
"test_prepare_directory"
"test_prepare_directory_with_extensions"
"test_prepare_directory_editable"
"test_installer_with_pypi_repository"
] ++ lib.optionals (pythonAtLeast "3.10") [
# RuntimeError: 'auto_spec' might be a typo; use unsafe=True if this is intended
"test_info_setup_complex_pep517_error"
Expand Down