From a932804c790f69160b6550a1517fe47af4efe136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sloup?= Date: Thu, 4 Aug 2022 10:30:16 +0200 Subject: [PATCH] Rebase to the latest upstream version Create patch files instead of sed Fix release numbering --- .gitignore | 1 + python-psycopg3-3.0.16-setup.patch | 27 ++++++++++++++++ python-psycopg3-3.0.16-toml.patch | 8 +++++ python-psycopg3.spec | 49 ++++++++++++------------------ sources | 2 +- 5 files changed, 56 insertions(+), 31 deletions(-) create mode 100644 python-psycopg3-3.0.16-setup.patch create mode 100644 python-psycopg3-3.0.16-toml.patch diff --git a/.gitignore b/.gitignore index 4a22ac5..1b6541e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /3.0.11.tar.gz +/3.0.16.tar.gz diff --git a/python-psycopg3-3.0.16-setup.patch b/python-psycopg3-3.0.16-setup.patch new file mode 100644 index 0000000..8d714d5 --- /dev/null +++ b/python-psycopg3-3.0.16-setup.patch @@ -0,0 +1,27 @@ +diff -ur 3.0.16_original/psycopg-3.0.16/psycopg/setup.py 3.0.16/psycopg-3.0.16/psycopg/setup.py +--- 3.0.16_original/psycopg-3.0.16/psycopg/setup.py 2022-08-04 09:58:06.504188489 +0200 ++++ 3.0.16/psycopg-3.0.16/psycopg/setup.py 2022-08-04 09:58:18.283216078 +0200 +@@ -38,20 +38,17 @@ + # Requirements to run the test suite + "test": [ + "mypy >= 0.920, != 0.930, != 0.931", +- "pproxy >= 2.7", +- "pytest >= 6.2.5", ++ "pytest", + # 0.16 is still needed to support Python 3.6. + # Only pinned in Psycopg 3.0.x as Psycopg 3.1.x is Py >= 3.7 only. + # - 0.17 requires asyncio_mode in config or it fails with a warning. + # - 0.16 fails if asyncio_mode is in the config. +- "pytest-asyncio >= 0.16, < 0.17", +- "pytest-cov >= 3.0", +- "pytest-randomly >= 3.10", ++ "pytest-asyncio", ++ "pytest-randomly", + ], + # Requirements needed for development + "dev": [ + "black >= 22.3.0", +- "dnspython >= 2.1", + "flake8 >= 4.0", + "mypy >= 0.920, != 0.930, != 0.931", + "types-setuptools >= 57.4", diff --git a/python-psycopg3-3.0.16-toml.patch b/python-psycopg3-3.0.16-toml.patch new file mode 100644 index 0000000..084d7f0 --- /dev/null +++ b/python-psycopg3-3.0.16-toml.patch @@ -0,0 +1,8 @@ +diff -ur 3.0.16_original/psycopg-3.0.16/psycopg/pyproject.toml 3.0.16/psycopg-3.0.16/psycopg/pyproject.toml +--- 3.0.16_original/psycopg-3.0.16/psycopg/pyproject.toml 2022-07-28 13:20:04.000000000 +0200 ++++ 3.0.16/psycopg-3.0.16/psycopg/pyproject.toml 2022-08-04 09:56:33.390970426 +0200 +@@ -1,3 +1,3 @@ + [build-system] +-requires = ["setuptools>=49.2.0", "wheel>=0.37"] ++requires = ["setuptools>=49.2.0", "wheel"] + build-backend = "setuptools.build_meta" diff --git a/python-psycopg3.spec b/python-psycopg3.spec index 53de28e..6cd1404 100644 --- a/python-psycopg3.spec +++ b/python-psycopg3.spec @@ -7,14 +7,21 @@ any other DB-API 2.0 database adapter, but allows to use more modern PostgreSQL and Python features.} Name: python-%{src_name} -Version: 3.0.11 -Release: 3%{?dist} +Version: 3.0.16 +Release: 1%{?dist} Summary: Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python License: LGPLv3 URL: https://www.psycopg.org/%{src_name}/ Source0: https://github.com/%{package_name}/%{package_name}/archive/refs/tags/%{version}.tar.gz +# Patch remove packages not availible in Fedora (pproxy) +# and removes specific version and code coverage +# Remove specific version to ensure build on +# Fedora 35 (pytest, pytest-randomly) + toml +Patch0: python-psycopg3-3.0.16-setup.patch +Patch1: python-psycopg3-3.0.16-toml.patch + BuildRequires: python3-devel # Required for running tests @@ -31,32 +38,7 @@ Summary: %{SUMMARY} %description -n python3-%{src_name} %_description %prep -%autosetup -p1 -n %{package_name}-%{version}/%{package_name} - -# Remove unused packages for tests and versions not available -# in Fedora -sed -i '/pproxy/d' setup.py - -# This package is removed as the code coverage does not have -# to be tested -sed -i '/pytest-cov/d' setup.py - -# This line removes the version since it is not supported -# in Fedora, introduces breaking changes in package -sed -i -r 's/(pytest-asyncio).*",/\1",/' setup.py - -# Remove versions to ensure build on Fedora 35 -# These versions should not be needed as always in -# upstream, there are versions with no breaking changes -%if 0%{?fedora} < 36 -sed -i -r 's/(wheel).*/\1"\]/' pyproject.toml -sed -i -r 's/(pytest) >=.*",/\1",/' setup.py -sed -i -r 's/(pytest-randomly).*",/\1",/' setup.py -%endif - -# Tests fail when installed since DNS configuration is not -# available -sed -i '/dnspython/d' setup.py +%autosetup -p3 -n %{package_name}-%{version}/%{package_name} %generate_buildrequires %pyproject_buildrequires -x test @@ -72,6 +54,8 @@ sed -i '/dnspython/d' setup.py pushd ../tests/ # Remove failing tests +# The DNS package is not installed and therefore the test +# will not run. This is intented as there is no network in mock rm test_typing.py test_module.py # Remove all files in pool/ folder except the fix_pool.py. # The pool/fix_pool.py is in conftest.py as plugin @@ -98,10 +82,15 @@ popd %changelog -* Fri Jul 22 2022 Fedora Release Engineering - 3.0.11-3 +* Thu Aug 04 2022 Ondrej Sloup - 3.0.16-1 +- Rebase to the latest upstream version +- Create patch files instead of sed +- Fix release numbering + +* Fri Jul 22 2022 Fedora Release Engineering - 3.0.11-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild -* Tue Jun 14 2022 Python Maint - 3.0.11-2 +* Tue Jun 14 2022 Python Maint - 3.0.11-3 - Rebuilt for Python 3.11 * Fri May 13 2022 Ondrej Sloup - 3.0.11-2 diff --git a/sources b/sources index 63e2daa..a2e5aac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (3.0.11.tar.gz) = dc4afbf866c274e5feabb2bf74c81a3ea17b216c82a0c75770f9699578ceb098b33b3af5ad43c3683be5123f6fd4767ab5a848ca091f4731911ac32e5409fe98 +SHA512 (3.0.16.tar.gz) = 655e01bb00972dacae590f2e8ce5948226acb827b55099e7f362fdee9210f07b755f4da10d2fadd468aa95eaa3f72e7658a1ab26870d4ac159ee266ce1f8140c