depot/third_party/nixpkgs/pkgs/development/python-modules/psycopg2/default.nix
Default email 83405b6dd2 Project import generated by Copybara.
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
2023-03-15 17:39:30 +01:00

54 lines
1.1 KiB
Nix

{ stdenv
, lib
, buildPythonPackage
, pythonOlder
, isPyPy
, fetchPypi
, postgresql
, openssl
, sphinxHook
, sphinx-better-theme
}:
buildPythonPackage rec {
pname = "psycopg2";
version = "2.9.5";
format = "setuptools";
# Extension modules don't work well with PyPy. Use psycopg2cffi instead.
# c.f. https://github.com/NixOS/nixpkgs/pull/104151#issuecomment-729750892
disabled = pythonOlder "3.6" || isPyPy;
src = fetchPypi {
inherit pname version;
hash = "sha256-pSRtLmg6ly4hh6hxS1ws+BVsBkYp+amxqHPBcw2eJFo=";
};
outputs = [ "out" "doc" ];
nativeBuildInputs = [
postgresql
sphinxHook
sphinx-better-theme
];
buildInputs = lib.optionals stdenv.isDarwin [
openssl
];
sphinxRoot = "doc/src";
# Requires setting up a PostgreSQL database
doCheck = false;
pythonImportsCheck = [
"psycopg2"
];
meta = with lib; {
description = "PostgreSQL database adapter for the Python programming language";
homepage = "https://www.psycopg.org";
license = with licenses; [ lgpl3Plus zpl20 ];
maintainers = with maintainers; [ ];
};
}