From c3805e7df16c2275ebf61c2de9566a6f97c973ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 26 Feb 2025 19:09:56 +0100 Subject: [PATCH 1/2] python313Packages.psycopg: misc cleanup --- pkgs/development/python-modules/psycopg/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index 51a0bdca487a..07d596eadd73 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -173,7 +173,7 @@ buildPythonPackage rec { pytestCheckHook postgresql ] - ++ lib.optional (stdenv.hostPlatform.isLinux) postgresqlTestHook + ++ lib.optional stdenv.hostPlatform.isLinux postgresqlTestHook ++ optional-dependencies.c ++ optional-dependencies.pool; @@ -187,7 +187,7 @@ buildPythonPackage rec { '' cd .. '' - + lib.optionalString (stdenv.hostPlatform.isLinux) '' + + lib.optionalString stdenv.hostPlatform.isLinux '' export PSYCOPG_TEST_DSN="host=/build/run/postgresql user=$PGUSER" ''; @@ -219,7 +219,7 @@ buildPythonPackage rec { ]; postCheck = '' - cd ${pname} + cd psycopg ''; passthru = { From 5296085430935acc4aba2581f68197ff9c86bd72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 26 Feb 2025 19:10:09 +0100 Subject: [PATCH 2/2] python313Packages.psycopg: disable docs when cross compiling --- .../python-modules/psycopg/default.nix | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index 07d596eadd73..c9825a6528e5 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -121,10 +121,13 @@ buildPythonPackage rec { disabled = pythonOlder "3.7"; - outputs = [ - "out" - "doc" - ]; + outputs = + [ + "out" + ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + "doc" + ]; sphinxRoot = "../docs"; @@ -141,13 +144,18 @@ buildPythonPackage rec { cd psycopg ''; - nativeBuildInputs = [ - furo - setuptools - shapely - sphinx-autodoc-typehints - sphinxHook - ]; + nativeBuildInputs = + [ + furo + setuptools + shapely + ] + # building the docs fails with the following error when cross compiling + # AttributeError: module 'psycopg_c.pq' has no attribute '__impl__' + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + sphinx-autodoc-typehints + sphinxHook + ]; propagatedBuildInputs = [ psycopg-c