diff --git a/pkgs/by-name/po/poetry/package.nix b/pkgs/by-name/po/poetry/package.nix index b6d61b80e179..730fdbbc7140 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); @@ -41,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-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 ]; 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"; 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 ]; + }; +} 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"; }; } 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 = [ 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