From f7cb58ecd72ca5341e5379406a4a4ce444b6a3a9 Mon Sep 17 00:00:00 2001 From: Zev Isert Date: Thu, 12 Mar 2026 16:08:55 -0700 Subject: [PATCH] poetryPlugins.poetry-plugin-migrate: init at 0.1.1 Poetry 2 is the latest version of poetry in nixpkgs-unstable, so this plugin will likely be widely used as poetry users adopt the new major version of poetry. Co-authored-by: qzylinra Co-authored-by: dotlambda --- pkgs/by-name/po/poetry/package.nix | 1 + .../poetry/plugins/poetry-plugin-migrate.nix | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/by-name/po/poetry/plugins/poetry-plugin-migrate.nix diff --git a/pkgs/by-name/po/poetry/package.nix b/pkgs/by-name/po/poetry/package.nix index 749858239819..cd313e827654 100644 --- a/pkgs/by-name/po/poetry/package.nix +++ b/pkgs/by-name/po/poetry/package.nix @@ -40,6 +40,7 @@ let 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 { }; + poetry-plugin-migrate = callPackage ./plugins/poetry-plugin-migrate.nix { }; poetry-plugin-poeblix = callPackage ./plugins/poetry-plugin-poeblix.nix { }; poetry-plugin-shell = callPackage ./plugins/poetry-plugin-shell.nix { }; }; diff --git a/pkgs/by-name/po/poetry/plugins/poetry-plugin-migrate.nix b/pkgs/by-name/po/poetry/plugins/poetry-plugin-migrate.nix new file mode 100644 index 000000000000..9939eb145d4a --- /dev/null +++ b/pkgs/by-name/po/poetry/plugins/poetry-plugin-migrate.nix @@ -0,0 +1,44 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + poetry, + pytest-mock, + pytestCheckHook, +}: +buildPythonPackage rec { + pname = "poetry-plugin-migrate"; + version = "0.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "zyf722"; + repo = "poetry-plugin-migrate"; + tag = version; + hash = "sha256-78H4/vHp8W7h6v6OWUdx9pX4142YiNGUFZXHoxxXw1M="; + }; + + build-system = [ + poetry-core + ]; + + buildInputs = [ + poetry + ]; + + pythonImportsCheck = [ "poetry_plugin_migrate" ]; + + nativeCheckInputs = [ + pytest-mock + pytestCheckHook + ]; + + meta = { + description = "Poetry plugin to migrate pyproject.toml from Poetry v1 to v2 (PEP-621 compliant)"; + homepage = "https://github.com/zyf722/poetry-plugin-migrate"; + changelog = "https://github.com/zyf722/poetry-plugin-migrate/releases/tag/${src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ zevisert ]; + }; +}