From db0be3a5588322fb1cde9d0fd666a4cf08949abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 5 Jan 2025 05:01:08 -0800 Subject: [PATCH 1/6] poetry: 1.8.5 -> 2.0.0 Diff: https://github.com/python-poetry/poetry/compare/refs/tags/1.8.5...2.0.0 Changelog: https://github.com/python-poetry/poetry/blob/refs/tags/2.0.0/CHANGELOG.md --- pkgs/by-name/po/poetry/package.nix | 19 ++++++++++++++++--- pkgs/by-name/po/poetry/unwrapped.nix | 25 ++++++++++++++----------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/po/poetry/package.nix b/pkgs/by-name/po/poetry/package.nix index b6d61b80e179..8bfd4547c756 100644 --- a/pkgs/by-name/po/poetry/package.nix +++ b/pkgs/by-name/po/poetry/package.nix @@ -17,14 +17,27 @@ let # We keep the override around even when the versions match, as # it's likely to become relevant again after the next Poetry update. poetry-core = super.poetry-core.overridePythonAttrs (old: rec { - version = "1.9.1"; + version = "2.0.0"; src = fetchFromGitHub { owner = "python-poetry"; repo = "poetry-core"; - rev = "refs/tags/${version}"; - hash = "sha256-L8lR9sUdRYqjkDCQ0XHXZm5X6xD40t1gxlGiovvb/+8="; + tag = version; + hash = "sha256-3dmvFn2rxtR0SK8oiEHIVJhpJpX4Mm/6kZnIYNSDv90="; }; patches = [ ]; + nativeCheckInputs = + old.nativeCheckInputs + ++ (with self; [ + trove-classifiers + ]); + disabledTests = old.disabledTests ++ [ + # relies on git + "test_package_with_include" + # Nix changes timestamp + "test_dist_info_date_time_default_value" + "test_sdist_members_mtime_default" + "test_sdist_mtime_zero" + ]; }); } // (plugins self); diff --git a/pkgs/by-name/po/poetry/unwrapped.nix b/pkgs/by-name/po/poetry/unwrapped.nix index 335d2ba8089d..ba26b7d54be0 100644 --- a/pkgs/by-name/po/poetry/unwrapped.nix +++ b/pkgs/by-name/po/poetry/unwrapped.nix @@ -4,21 +4,19 @@ buildPythonPackage, pythonOlder, fetchFromGitHub, + fetchpatch2, installShellFiles, build, cachecontrol, cleo, - crashtest, dulwich, fastjsonschema, installer, keyring, packaging, - pexpect, pkginfo, platformdirs, poetry-core, - poetry-plugin-export, pyproject-hooks, requests, requests-toolbelt, @@ -39,18 +37,26 @@ buildPythonPackage rec { pname = "poetry"; - version = "1.8.5"; + version = "2.0.0"; pyproject = true; - disabled = pythonOlder "3.8"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "python-poetry"; repo = "poetry"; - rev = "refs/tags/${version}"; - hash = "sha256-YR0IgDhmpbe8TyTMP1cjUxGRnrfV8CNHkPlZrNcnof0="; + tag = version; + hash = "sha256-r4TK4CKDfCeCW+Y1vUoS4ppXmn5xEvI1ZBVUHqFJLKo="; }; + patches = [ + # https://github.com/python-poetry/poetry/pull/9939 + (fetchpatch2 { + url = "https://github.com/python-poetry/poetry/commit/89c0d02761229a8aa7ac5afcbc8935387bde4c5b.patch?full_index=1"; + hash = "sha256-YuAevkmCSTGuFPfuKrJfcLUye1YGpnHSb9TFSW7F1SU="; + }) + ]; + build-system = [ poetry-core ]; @@ -70,17 +76,14 @@ buildPythonPackage rec { build cachecontrol cleo - crashtest dulwich fastjsonschema installer keyring packaging - pexpect pkginfo platformdirs poetry-core - poetry-plugin-export pyproject-hooks requests requests-toolbelt @@ -136,8 +139,8 @@ buildPythonPackage rec { disabledTests = [ "test_builder_should_execute_build_scripts" "test_env_system_packages_are_relative_to_lib" - "test_executor_known_hashes" "test_install_warning_corrupt_root" + "test_project_plugins_are_installed_in_project_folder" ]; pytestFlagsArray = [ From a0fea4f1bd227945bfd1e7771ee4a2976cb2e5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 5 Jan 2025 05:19:48 -0800 Subject: [PATCH 2/6] poetryPlugins.poetry-plugin-shell: init at 1.0.0 --- pkgs/by-name/po/poetry/package.nix | 1 + .../po/poetry/plugins/poetry-plugin-shell.nix | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix diff --git a/pkgs/by-name/po/poetry/package.nix b/pkgs/by-name/po/poetry/package.nix index 8bfd4547c756..730fdbbc7140 100644 --- a/pkgs/by-name/po/poetry/package.nix +++ b/pkgs/by-name/po/poetry/package.nix @@ -54,6 +54,7 @@ let poetry-plugin-export = callPackage ./plugins/poetry-plugin-export.nix { }; poetry-plugin-up = callPackage ./plugins/poetry-plugin-up.nix { }; poetry-plugin-poeblix = callPackage ./plugins/poetry-plugin-poeblix.nix { }; + poetry-plugin-shell = callPackage ./plugins/poetry-plugin-shell.nix { }; }; # selector is a function mapping pythonPackages to a list of plugins diff --git a/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix b/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix new file mode 100644 index 000000000000..ff3abe44fc67 --- /dev/null +++ b/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix @@ -0,0 +1,50 @@ +{ + buildPythonPackage, + fetchFromGitHub, + lib, + pexpect, + poetry, + poetry-core, + pytest-mock, + pytest-xdist, + pytestCheckHook, + shellingham, +}: + +buildPythonPackage rec { + pname = "poetry-plugin-shell"; + version = "1.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "python-poetry"; + repo = "poetry-plugin-shell"; + tag = version; + hash = "sha256-ynbZCzic6bAIwtG0rGk4oMPc8pm59UFboNAGUb0qJnE="; + }; + + build-system = [ poetry-core ]; + + buildInputs = [ + poetry + ]; + + dependencies = [ + pexpect + shellingham + ]; + + nativeCheckInputs = [ + pytest-mock + pytest-xdist + pytestCheckHook + ]; + + meta = { + changelog = "https://github.com/python-poetry/poetry-plugin-shell/blob/${src.tag}/CHANGELOG.md"; + description = "Poetry plugin to run subshell with virtual environment activated"; + homepage = "https://github.com/python-poetry/poetry-plugin-shell"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} From 0a29203c56873eb959d40e067b1ec502cab3e6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 5 Jan 2025 06:19:17 -0800 Subject: [PATCH 3/6] python312Packages.safety-schemas: unpin pydantic --- pkgs/development/python-modules/safety-schemas/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/safety-schemas/default.nix b/pkgs/development/python-modules/safety-schemas/default.nix index 6c1c42086b02..8fb9813726d3 100644 --- a/pkgs/development/python-modules/safety-schemas/default.nix +++ b/pkgs/development/python-modules/safety-schemas/default.nix @@ -23,6 +23,10 @@ buildPythonPackage rec { build-system = [ hatchling ]; + pythonRelaxDeps = [ + "pydantic" + ]; + dependencies = [ dparse packaging From da16b33bc91e5f6766df936326ad56d34162ea70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 6 Jan 2025 06:37:36 -0800 Subject: [PATCH 4/6] poetryPlugins.poetry-audit-plugin: unpin poetry --- pkgs/by-name/po/poetry/plugins/poetry-audit-plugin.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/po/poetry/plugins/poetry-audit-plugin.nix b/pkgs/by-name/po/poetry/plugins/poetry-audit-plugin.nix index ec9289738349..fd9c56acfea7 100644 --- a/pkgs/by-name/po/poetry/plugins/poetry-audit-plugin.nix +++ b/pkgs/by-name/po/poetry/plugins/poetry-audit-plugin.nix @@ -23,15 +23,19 @@ buildPythonPackage rec { hash = "sha256-kiNtzEup2ygCTk0zk8YV2jxAj6ZzOhP8v0U4FbV15hI="; }; - nativeBuildInputs = [ + build-system = [ poetry-core ]; + pythonRelaxDeps = [ + "poetry" + ]; + buildInputs = [ poetry ]; - propagatedBuildInputs = [ + dependencies = [ safety ]; From 4a6768d4f9cb49cce78dca5f73ddfff04969d982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 6 Jan 2025 06:41:49 -0800 Subject: [PATCH 5/6] poetryPlugins.poetry-plugin-export: run tests --- .../poetry/plugins/poetry-plugin-export.nix | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/po/poetry/plugins/poetry-plugin-export.nix b/pkgs/by-name/po/poetry/plugins/poetry-plugin-export.nix index e9539ccfaf53..d523af4b4808 100644 --- a/pkgs/by-name/po/poetry/plugins/poetry-plugin-export.nix +++ b/pkgs/by-name/po/poetry/plugins/poetry-plugin-export.nix @@ -2,7 +2,11 @@ lib, buildPythonPackage, fetchFromGitHub, + poetry, poetry-core, + pytest-mock, + pytest-xdist, + pytestCheckHook, }: buildPythonPackage rec { @@ -17,17 +21,19 @@ buildPythonPackage rec { hash = "sha256-ZXhj9FwCCNFMzyoAtQTD8bddOvVM4KzNtd+3sBn9i+w="; }; - postPatch = '' - sed -i '/poetry =/d' pyproject.toml - ''; - - nativeBuildInputs = [ + build-system = [ poetry-core ]; - # infinite recursion with poetry - doCheck = false; - pythonImportsCheck = [ ]; + buildInputs = [ + poetry + ]; + + nativeCheckInputs = [ + pytest-mock + pytest-xdist + pytestCheckHook + ]; meta = with lib; { changelog = "https://github.com/python-poetry/poetry-plugin-export/blob/${src.rev}/CHANGELOG.md"; From 40397fbf15f502b36aa1e57d193fda0b55a30e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 6 Jan 2025 06:44:01 -0800 Subject: [PATCH 6/6] poetryPlugins.poetry-plugin-up: mark broken --- pkgs/by-name/po/poetry/plugins/poetry-plugin-up.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/po/poetry/plugins/poetry-plugin-up.nix b/pkgs/by-name/po/poetry/plugins/poetry-plugin-up.nix index 90feed499dc2..dfc2de383b6a 100644 --- a/pkgs/by-name/po/poetry/plugins/poetry-plugin-up.nix +++ b/pkgs/by-name/po/poetry/plugins/poetry-plugin-up.nix @@ -20,14 +20,17 @@ buildPythonPackage rec { hash = "sha256-PWHbMDGL9CGLRmvFWLOztUW0f/TJioPjQtAgpyCbAqw="; }; - nativeBuildInputs = [ + build-system = [ poetry-core ]; + buildInputs = [ + poetry + ]; + nativeCheckInputs = [ pytestCheckHook pytest-mock - poetry ]; preCheck = '' @@ -40,5 +43,7 @@ buildPythonPackage rec { changelog = "https://github.com/MousaZeidBaker/poetry-plugin-up/releases/tag/${version}"; license = licenses.mit; maintainers = [ maintainers.k900 ]; + # https://github.com/MousaZeidBaker/poetry-plugin-up/pull/70 + broken = lib.versionAtLeast poetry.version "2"; }; }