From 41cbafe0e9bb7781a2dab7f0c70f8c1ff510d2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 15 Feb 2026 08:06:28 -0800 Subject: [PATCH] python3Packages.pglast: fix build --- .../python-modules/pglast/default.nix | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/pglast/default.nix b/pkgs/development/python-modules/pglast/default.nix index 1b523a71e4ab..d1048ca94524 100644 --- a/pkgs/development/python-modules/pglast/default.nix +++ b/pkgs/development/python-modules/pglast/default.nix @@ -1,9 +1,10 @@ { lib, buildPythonPackage, - fetchPypi, + cython, + fetchFromGitHub, pytest-cov-stub, - pytest, + pytestCheckHook, setuptools, }: @@ -12,24 +13,33 @@ buildPythonPackage rec { version = "7.11"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-d67Xi7eMDlbxaaQYM/b9x85jqjgwuMdx/CYxBaiDR0U="; + src = fetchFromGitHub { + owner = "lelit"; + repo = "pglast"; + tag = "v${version}"; + fetchSubmodules = true; + hash = "sha256-b8NrgfPhneERu3kXrrLmhGUSmcnz44SUuv3tBvZ55rE="; }; - build-system = [ setuptools ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail cython==3.2.3 cython \ + --replace-fail setuptools==80.9.0 setuptools + ''; - dependencies = [ setuptools ]; + build-system = [ + cython + setuptools + ]; nativeCheckInputs = [ - pytest + pytestCheckHook pytest-cov-stub ]; - # pytestCheckHook doesn't work - # ImportError: cannot import name 'parse_sql' from 'pglast' - checkPhase = '' - pytest + preCheck = '' + # import from $out + rm -r pglast ''; pythonImportsCheck = [