From 8b2d889aebdfe60b756005eec2013ac0767e5bfc Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Wed, 21 Apr 2021 11:22:49 -0700 Subject: [PATCH] python37Packages.poetry-core: fix build for python<=3.7 --- pkgs/development/python-modules/poetry-core/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/poetry-core/default.nix b/pkgs/development/python-modules/poetry-core/default.nix index bec70aacca72..4d8c444dcd20 100644 --- a/pkgs/development/python-modules/poetry-core/default.nix +++ b/pkgs/development/python-modules/poetry-core/default.nix @@ -23,6 +23,13 @@ buildPythonPackage rec { sha256 = "07x0zagf9cfr7g3132jjd5byywkbnzpfbxjfjzpzpj70fqw70qrc"; }; + postPatch = lib.optionalString (pythonOlder "3.8") '' + # remove >1.0.3 + substituteInPlace pyproject.toml \ + --replace 'importlib-metadata = {version = "^1.7.0", python = "~2.7 || >=3.5, <3.8"}' \ + 'importlib-metadata = {version = ">=1.7.0", python = "~2.7 || >=3.5, <3.8"}' + ''; + nativeBuildInputs = [ intreehooks ];