2021-06-28 23:13:55 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, isPyPy
|
|
|
|
, fetchPypi
|
|
|
|
, postgresql
|
|
|
|
, openssl
|
2022-06-16 17:23:12 +00:00
|
|
|
, sphinxHook
|
|
|
|
, sphinx-better-theme
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "psycopg2";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "2.9.3";
|
2022-06-16 17:23:12 +00:00
|
|
|
outputs = [ "out" "doc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
# Extension modules don't work well with PyPy. Use psycopg2cffi instead.
|
|
|
|
# c.f. https://github.com/NixOS/nixpkgs/pull/104151#issuecomment-729750892
|
2021-06-28 23:13:55 +00:00
|
|
|
disabled = pythonOlder "3.6" || isPyPy;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "8e841d1bf3434da985cc5ef13e6f75c8981ced601fd70cc6bf33351b91562981";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
postgresql
|
2022-06-16 17:23:12 +00:00
|
|
|
sphinxHook
|
|
|
|
sphinx-better-theme
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
openssl
|
|
|
|
];
|
|
|
|
|
|
|
|
# requires setting up a postgresql database
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
sphinxRoot = "doc/src";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "PostgreSQL database adapter for the Python programming language";
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://www.psycopg.org";
|
|
|
|
license = with licenses; [ lgpl3 zpl20 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|