Files
nixpkgs/pkgs/development/python-modules/psycopg2cffi/default.nix
T
Martin Weinelt 4be421cc73 python312Packages.psycopg2cffi: 2.8.1 -> 2.9.0
https://github.com/chtd/psycopg2cffi/compare/2.8.1...2.9.0

- Return from fork to upstream
- Migrate to PEP517 builder
- Patch out distutils for Python 3.12 compat
- Stop running tests on Darwin, since PostgreSQL is not allowed to
  allocate the required shared memory segment
2024-05-12 15:46:14 +02:00

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 = "An implementation of the psycopg2 module using cffi";
homepage = "https://pypi.org/project/psycopg2cffi/";
license = with licenses; [ lgpl3Plus ];
maintainers = with maintainers; [ lovesegfault ];
};
}