[arch-commits] Commit in python-pg8000/trunk (PKGBUILD postgresql-12.diff)

Chih-Hsuan Yen yan12125 at archlinux.org
Mon Jul 13 02:27:15 UTC 2020


    Date: Monday, July 13, 2020 @ 02:27:15
  Author: yan12125
Revision: 663396

upgpkg: python-pg8000 1.16.0-1; also fixes check()

Added:
  python-pg8000/trunk/postgresql-12.diff
Modified:
  python-pg8000/trunk/PKGBUILD

--------------------+
 PKGBUILD           |   25 +++++++++++++++++++------
 postgresql-12.diff |   17 +++++++++++++++++
 2 files changed, 36 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-07-13 02:10:17 UTC (rev 663395)
+++ PKGBUILD	2020-07-13 02:27:15 UTC (rev 663396)
@@ -2,7 +2,7 @@
 # Contributor: quomoow <quomoow at gmail.com>
 
 pkgname=python-pg8000
-pkgver=1.15.3
+pkgver=1.16.0
 pkgrel=1
 pkgdesc="Pure-Python PostgreSQL database driver, DB-API compatible"
 arch=(any)
@@ -9,14 +9,19 @@
 url='https://github.com/tlocke/pg8000'
 license=(BSD)
 makedepends=(python-setuptools)
-checkdepends=(python-pytest python-pytz pifpaf postgresql)
+checkdepends=(python-pytest python-pytest-mock python-pytz pifpaf postgresql)
 depends=(python python-scramp)
-source=("https://github.com/tlocke/pg8000/archive/$pkgver/pg8000-$pkgver.tar.gz")
-sha256sums=('919793109ac0c02e073eae7a845647658b4eb8967f860a878295150cb0999e5e')
+source=("https://github.com/tlocke/pg8000/archive/$pkgver/pg8000-$pkgver.tar.gz"
+        postgresql-12.diff)
+sha256sums=('dbba2061f4e5f7a405bdd7839ddfd1e180b1a4844279f21eb77bed3808bee4af'
+            '31693ddabeb8d772949ecbfd0f917223802be85039a613e083ecdeee417576db')
 
 prepare() {
   cd pg8000-$pkgver
 
+  # https://github.com/tlocke/pg8000/issues/46
+  patch -Np1 -i ../postgresql-12.diff
+
   # Remove upper bounds of dependencies
   sed --in-place=.orig -r 's#,?<[0-9.]+,?##;s#==([0-9.]+)#>=\1#' setup.py
   diff -u setup.py{.orig,} || true
@@ -29,8 +34,16 @@
 
 check() {
   cd pg8000-$pkgver
-  # TODO
-  PYTHONPATH="$PWD" pifpaf run postgresql -- pytest -v test || echo Tests fail!
+  # See upstream .travis.yml for initialization SQL commands
+  # XXX: The postgres plugin in pifpaf does not listen on a TCP port
+  #      without --host
+  # XXX: testGss and testSsl needs custom pg_hba.conf and postgresql.conf,
+  #      and pifpaf does not support that yet
+  PYTHONPATH="$PWD" pifpaf run postgresql --host localhost -- bash -c "
+    psql -c \"CREATE ROLE postgres WITH LOGIN SUPERUSER PASSWORD 'pw';\"
+    psql -c \"create extension hstore;\"
+    pytest -v test -k 'not testGss and not testSsl'
+  "
 }
 
 package() {

Added: postgresql-12.diff
===================================================================
--- postgresql-12.diff	                        (rev 0)
+++ postgresql-12.diff	2020-07-13 02:27:15 UTC (rev 663396)
@@ -0,0 +1,17 @@
+diff --git a/test/test_copy.py b/test/test_copy.py
+index e46b8d2..847fef3 100644
+--- a/test/test_copy.py
++++ b/test/test_copy.py
+@@ -71,10 +71,10 @@ def test_copy_from_with_error(db_table):
+         arg = {
+             'S': 'ERROR',
+             'C': '22P02',
+-            'M': 'invalid input syntax for integer: ""',
++            'M': 'invalid input syntax for type integer: ""',
+             'W': 'COPY t1, line 2, column f1: ""',
+             'F': 'numutils.c',
+-            'R': 'pg_atoi'
++            'R': 'pg_strtoint32'
+         }
+         earg = e.value.args[0]
+         for k, v in arg.items():



More information about the arch-commits mailing list