From 695b93b0795da031baeb0d46319d7b5710d40842 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 18 May 2022 11:22:15 +0200 Subject: [PATCH 1/4] python310Packages.pg8000: 1.28.0 -> 1.28.2 --- pkgs/development/python-modules/pg8000/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pg8000/default.nix b/pkgs/development/python-modules/pg8000/default.nix index b3ac256e0bb5..ac09e1a6f0bc 100644 --- a/pkgs/development/python-modules/pg8000/default.nix +++ b/pkgs/development/python-modules/pg8000/default.nix @@ -8,14 +8,14 @@ buildPythonPackage rec { pname = "pg8000"; - version = "1.28.0"; - format = "setuptools"; + version = "1.28.2"; + format = "pyproject"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "sha256-Q1E949TjeOc6xEKpOQa6qdNWJFqmeqf2FgXFbjmn9ZE="; + sha256 = "sha256-4aJLqJobQeLSCVuf188W2vm1vf8g85WNmX3fg2GkyLU="; }; propagatedBuildInputs = [ From c2261bce535eb7e8887c8134a0d4f5c499eac8a6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 18 May 2022 20:47:34 +0200 Subject: [PATCH 2/4] python310Packages.pg8000: 1.28.2 -> 1.28.3 --- pkgs/development/python-modules/pg8000/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pg8000/default.nix b/pkgs/development/python-modules/pg8000/default.nix index ac09e1a6f0bc..54241dde5702 100644 --- a/pkgs/development/python-modules/pg8000/default.nix +++ b/pkgs/development/python-modules/pg8000/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchPypi +, importlib-metadata , passlib , pythonOlder , scramp @@ -8,19 +9,21 @@ buildPythonPackage rec { pname = "pg8000"; - version = "1.28.2"; + version = "1.28.3"; format = "pyproject"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "sha256-4aJLqJobQeLSCVuf188W2vm1vf8g85WNmX3fg2GkyLU="; + sha256 = "sha256-1hA3s/Iff8fVz+TupoN4klnnzLnu9fcinLxi8x6mujI="; }; propagatedBuildInputs = [ passlib scramp + ] ++ lib.optionals (pythonOlder "3.8") [ + importlib-metadata ]; # Tests require a running PostgreSQL instance From 3c6a6e5eed857fa704c4a3cc21085cf80a9b2552 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 27 May 2022 18:33:02 +0200 Subject: [PATCH 3/4] python310Packages.pg8000: 1.28.3 -> 1.29.1 --- pkgs/development/python-modules/pg8000/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pg8000/default.nix b/pkgs/development/python-modules/pg8000/default.nix index 54241dde5702..4ae1daa17951 100644 --- a/pkgs/development/python-modules/pg8000/default.nix +++ b/pkgs/development/python-modules/pg8000/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "pg8000"; - version = "1.28.3"; + version = "1.29.1"; format = "pyproject"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-1hA3s/Iff8fVz+TupoN4klnnzLnu9fcinLxi8x6mujI="; + hash = "sha256-gLT03ksCVIMreUhRHg3UY0LRwERszU/diStj0C5PvHs="; }; propagatedBuildInputs = [ @@ -26,6 +26,10 @@ buildPythonPackage rec { importlib-metadata ]; + postPatch = '' + sed '/^\[metadata\]/a version = ${version}' setup.cfg + ''; + # Tests require a running PostgreSQL instance doCheck = false; From 47d7ecfcea24ce6c4806fe4edae4cba3c324313c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 27 May 2022 18:33:38 +0200 Subject: [PATCH 4/4] python310Packages.testing-postgresql: disable on older Python releases --- .../testing-postgresql/default.nix | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/testing-postgresql/default.nix b/pkgs/development/python-modules/testing-postgresql/default.nix index 7ebff6ccc365..fd88ea03bf72 100644 --- a/pkgs/development/python-modules/testing-postgresql/default.nix +++ b/pkgs/development/python-modules/testing-postgresql/default.nix @@ -1,32 +1,60 @@ -{ lib, buildPythonPackage, fetchFromGitHub, postgresql, testing-common-database -, pg8000, pytestCheckHook, psycopg2, sqlalchemy }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pg8000 +, postgresql +, psycopg2 +, pytestCheckHook +, pythonOlder +, sqlalchemy +, testing-common-database +}: buildPythonPackage rec { - pname = "testing.postgresql"; + pname = "testing-postgresql"; # Version 1.3.0 isn't working so let's use the latest commit from GitHub version = "unstable-2017-10-31"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "tk0miya"; - repo = pname; + repo = "testing.postgresql"; rev = "c81ded434d00ec8424de0f9e1f4063c778c6aaa8"; - sha256 = "1asqsi38di768i1sc1qm1k068dj0906ds6lnx7xcbxws0s25m2q3"; + sha256 = "sha256-A4tahAaa98X66ZYa3QxIQDZkwAwVB6ZDRObEhkbUWKs="; }; + propagatedBuildInputs = [ + testing-common-database + pg8000 + ]; + + checkInputs = [ + pytestCheckHook + psycopg2 + sqlalchemy + ]; + # Add PostgreSQL to search path prePatch = '' substituteInPlace src/testing/postgresql.py \ --replace "/usr/local/pgsql" "${postgresql}" ''; - propagatedBuildInputs = [ testing-common-database pg8000 ]; + postPatch = '' + substituteInPlace setup.py \ + --replace "pg8000 >= 1.10" "pg8000" + ''; + + pythonImportsCheck = [ + "testing.postgresql" + ]; # Fix tests for Darwin build. See: # https://github.com/NixOS/nixpkgs/pull/74716#issuecomment-598546916 __darwinAllowLocalNetworking = true; - checkInputs = [ pytestCheckHook psycopg2 sqlalchemy ]; - meta = with lib; { description = "Use temporary postgresql instance in testing"; homepage = "https://github.com/tk0miya/testing.postgresql";