python3.pkgs.xpath-expressions: replace poetry with poetry-core

This commit is contained in:
Theodore Ni 2023-08-23 14:35:49 -07:00
parent db4ba9acad
commit a81ac2a830
No known key found for this signature in database
GPG Key ID: 48B67583BDDD4474

View File

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, lxml
, poetry-core
, pythonOlder
@ -10,16 +11,25 @@
buildPythonPackage rec {
pname = "xpath-expressions";
version = "1.1.0";
disabled = pythonOlder "3.5";
format = "pyproject";
disabled = pythonOlder "3.5";
src = fetchFromGitHub {
owner = "orf";
repo = pname;
rev = "v${version}";
sha256 = "0l289iw2zmzxyfi3g2z7b917vmsaz47h5jp871zvykpmpigc632h";
hash = "sha256-UAzDXrz1Tr9/OOjKAg/5Std9Qlrnizei8/3XL3hMSFA=";
};
patches = [
# https://github.com/orf/xpath-expressions/pull/4
(fetchpatch {
name = "replace-poetry-with-poetry-core.patch";
url = "https://github.com/orf/xpath-expressions/commit/3c5900fd6b2d08dd9468707f35ab42072cf75bd3.patch";
hash = "sha256-IeV6ncJyt/w2s5TPpbM5a3pljNT6Bp5PIiqgTg2iTRA=";
})
];
nativeBuildInputs = [
poetry-core
];
@ -29,12 +39,6 @@ buildPythonPackage rec {
pytestCheckHook
];
postPatch = ''
# Was fixed upstream but not released
substituteInPlace pyproject.toml \
--replace "poetry.masonry.api" "poetry.core.masonry.api"
'';
pythonImportsCheck = [ "xpath" ];
meta = with lib; {