nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 40 lines 874 B view raw
1{ stdenv 2, lib 3, buildPythonPackage 4, pythonOlder 5, isPyPy 6, fetchPypi 7, postgresql 8, openssl 9}: 10 11buildPythonPackage rec { 12 pname = "psycopg2"; 13 version = "2.9.3"; 14 15 # Extension modules don't work well with PyPy. Use psycopg2cffi instead. 16 # c.f. https://github.com/NixOS/nixpkgs/pull/104151#issuecomment-729750892 17 disabled = pythonOlder "3.6" || isPyPy; 18 19 src = fetchPypi { 20 inherit pname version; 21 sha256 = "8e841d1bf3434da985cc5ef13e6f75c8981ced601fd70cc6bf33351b91562981"; 22 }; 23 24 nativeBuildInputs = [ 25 postgresql 26 ]; 27 28 buildInputs = lib.optionals stdenv.isDarwin [ 29 openssl 30 ]; 31 32 # requires setting up a postgresql database 33 doCheck = false; 34 35 meta = with lib; { 36 description = "PostgreSQL database adapter for the Python programming language"; 37 homepage = "https://www.psycopg.org"; 38 license = with licenses; [ lgpl3 zpl20 ]; 39 }; 40}