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-11-02 22:02:43 +00:00
|
|
|
version = "2.9.5";
|
|
|
|
format = "setuptools";
|
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;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-pSRtLmg6ly4hh6hxS1ws+BVsBkYp+amxqHPBcw2eJFo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
sphinxRoot = "doc/src";
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
# Requires setting up a PostgreSQL database
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"psycopg2"
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
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";
|
2022-11-02 22:02:43 +00:00
|
|
|
license = with licenses; [ lgpl3Plus zpl20 ];
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|