nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python310Packages.testing-postgresql: disable on older Python releases

+36 -8
+36 -8
pkgs/development/python-modules/testing-postgresql/default.nix
··· 1 - { lib, buildPythonPackage, fetchFromGitHub, postgresql, testing-common-database 2 - , pg8000, pytestCheckHook, psycopg2, sqlalchemy }: 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , pg8000 5 + , postgresql 6 + , psycopg2 7 + , pytestCheckHook 8 + , pythonOlder 9 + , sqlalchemy 10 + , testing-common-database 11 + }: 3 12 4 13 buildPythonPackage rec { 5 - pname = "testing.postgresql"; 14 + pname = "testing-postgresql"; 6 15 # Version 1.3.0 isn't working so let's use the latest commit from GitHub 7 16 version = "unstable-2017-10-31"; 17 + format = "setuptools"; 18 + 19 + disabled = pythonOlder "3.7"; 8 20 9 21 src = fetchFromGitHub { 10 22 owner = "tk0miya"; 11 - repo = pname; 23 + repo = "testing.postgresql"; 12 24 rev = "c81ded434d00ec8424de0f9e1f4063c778c6aaa8"; 13 - sha256 = "1asqsi38di768i1sc1qm1k068dj0906ds6lnx7xcbxws0s25m2q3"; 25 + sha256 = "sha256-A4tahAaa98X66ZYa3QxIQDZkwAwVB6ZDRObEhkbUWKs="; 14 26 }; 27 + 28 + propagatedBuildInputs = [ 29 + testing-common-database 30 + pg8000 31 + ]; 32 + 33 + checkInputs = [ 34 + pytestCheckHook 35 + psycopg2 36 + sqlalchemy 37 + ]; 15 38 16 39 # Add PostgreSQL to search path 17 40 prePatch = '' ··· 42 19 --replace "/usr/local/pgsql" "${postgresql}" 43 20 ''; 44 21 45 - propagatedBuildInputs = [ testing-common-database pg8000 ]; 22 + postPatch = '' 23 + substituteInPlace setup.py \ 24 + --replace "pg8000 >= 1.10" "pg8000" 25 + ''; 26 + 27 + pythonImportsCheck = [ 28 + "testing.postgresql" 29 + ]; 46 30 47 31 # Fix tests for Darwin build. See: 48 32 # https://github.com/NixOS/nixpkgs/pull/74716#issuecomment-598546916 49 33 __darwinAllowLocalNetworking = true; 50 - 51 - checkInputs = [ pytestCheckHook psycopg2 sqlalchemy ]; 52 34 53 35 meta = with lib; { 54 36 description = "Use temporary postgresql instance in testing";