depot/third_party/nixpkgs/pkgs/development/python-modules/psycopg2cffi/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

67 lines
1.3 KiB
Nix

{
buildPythonPackage,
cffi,
fetchFromGitHub,
lib,
postgresql,
postgresqlTestHook,
pytestCheckHook,
setuptools,
six,
stdenv,
}:
buildPythonPackage rec {
pname = "psycopg2cffi";
version = "2.9.0";
pyproject = true;
src = fetchFromGitHub {
owner = "chtd";
repo = "psycopg2cffi";
rev = "refs/tags/${version}";
hash = "sha256-9r5MYxw9cvdbLVj8StmMmn0AKQepOpCc7TIBGXZGWe4=";
};
postPatch = ''
substituteInPlace psycopg2cffi/_impl/_build_libpq.py \
--replace-fail "from distutils import sysconfig" "import sysconfig" \
--replace-fail "sysconfig.get_python_inc()" "sysconfig.get_path('include')"
'';
build-system = [
postgresql
setuptools
];
dependencies = [
cffi
six
];
# FATAL: could not create shared memory segment: Operation not permitted
doCheck = !stdenv.isDarwin;
nativeCheckInputs = [
postgresqlTestHook
pytestCheckHook
];
disabledTests = [
# AssertionError: '{}' != []
"testEmptyArray"
];
env = {
PGDATABASE = "psycopg2_test";
};
pythonImportsCheck = [ "psycopg2cffi" ];
meta = with lib; {
description = "Implementation of the psycopg2 module using cffi";
homepage = "https://pypi.org/project/psycopg2cffi/";
license = with licenses; [ lgpl3Plus ];
maintainers = with maintainers; [ lovesegfault ];
};
}