From 9d314e462da7f074a94082a9caad00fac3a38765 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Sep 2024 12:52:31 -0400 Subject: [PATCH] ilot/py3-testing-postgresql: new aport --- .../44_replace-assert-regeexp-matches.patch | 34 +++++++++++++++ ilot/py3-testing-postgresql/APKBUILD | 42 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ilot/py3-testing-postgresql/44_replace-assert-regeexp-matches.patch create mode 100644 ilot/py3-testing-postgresql/APKBUILD diff --git a/ilot/py3-testing-postgresql/44_replace-assert-regeexp-matches.patch b/ilot/py3-testing-postgresql/44_replace-assert-regeexp-matches.patch new file mode 100644 index 0000000..82ad198 --- /dev/null +++ b/ilot/py3-testing-postgresql/44_replace-assert-regeexp-matches.patch @@ -0,0 +1,34 @@ +From ec9ce743a0f51076d7ea2485a6fa58b72ec8e338 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 4 Aug 2023 10:58:08 -0400 +Subject: [PATCH] Replace assertRegexpMatches() with assertRegex() + +This alias was deprecated in Python 3.2 and is removed in Python 3.12. + +Reference: https://docs.python.org/3.12/whatsnew/3.12.html +--- + tests/test_postgresql.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py +index 1fa1116..b2bba20 100644 +--- a/tests/test_postgresql.py ++++ b/tests/test_postgresql.py +@@ -28,7 +28,7 @@ def test_basic(self): + # connect to postgresql (w/ psycopg2) + conn = psycopg2.connect(**pgsql.dsn()) + self.assertIsNotNone(conn) +- self.assertRegexpMatches(pgsql.read_bootlog(), 'is ready to accept connections') ++ self.assertRegex(pgsql.read_bootlog(), 'is ready to accept connections') + conn.close() + + # connect to postgresql (w/ sqlalchemy) +@@ -38,7 +38,7 @@ def test_basic(self): + # connect to postgresql (w/ pg8000) + conn = pg8000.connect(**pgsql.dsn()) + self.assertIsNotNone(conn) +- self.assertRegexpMatches(pgsql.read_bootlog(), 'is ready to accept connections') ++ self.assertRegex(pgsql.read_bootlog(), 'is ready to accept connections') + conn.close() + finally: + # shutting down diff --git a/ilot/py3-testing-postgresql/APKBUILD b/ilot/py3-testing-postgresql/APKBUILD new file mode 100644 index 0000000..05a0f0f --- /dev/null +++ b/ilot/py3-testing-postgresql/APKBUILD @@ -0,0 +1,42 @@ +# Contributor: Antoine Martin (ayakael) +# Maintainer: Antoine Martin (ayakael) +pkgname=py3-testing-postgresql +#_pkgreal is used by apkbuild-pypi to find modules at PyPI +_pkgreal=testing.postgresql +pkgver=1.3.0 +pkgrel=0 +pkgdesc="Automatically setups a postgresql instance in a temporary directory, and destroys it after testing" +url="https://pypi.python.org/project/testing.postgresql" +arch="noarch" +license="Apache-2.0" +depends="py3-testing-common-database py3-pg8000 postgresql" +checkdepends="py3-pytest py3-psycopg2 py3-sqlalchemy" +makedepends="py3-setuptools py3-gpep517 py3-wheel" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/tk0miya/testing.postgresql/archive/refs/tags/$pkgver.tar.gz + 44_replace-assert-regeexp-matches.patch + " +builddir="$srcdir/$_pkgreal-$pkgver" +subpackages="$pkgname-pyc" + +build() { + gpep517 build-wheel \ + --wheel-dir .dist \ + --output-fd 3 3>&1 >&2 +} + +check() { + python3 -m venv --clear --without-pip --system-site-packages .testenv + .testenv/bin/python3 -m installer .dist/*.whl + .testenv/bin/python3 -m pytest -v +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +7b907e4c11c67eb6a2e936e6b96fb90747dfe14d92b8864a3951071701da8888e583deec7d05d4c0bd145f4d7b03bd71434c2111116eccd9a001466021433720 py3-testing-postgresql-1.3.0.tar.gz +42a51e77c20daa98f981b58ae9c8efd422dda2d04e53497df61a4e500a2aff4fc6c58c5f298c796b5f8f180ec7625561373991eee0433b11a88c874775469d5a 44_replace-assert-regeexp-matches.patch +"