Rebase to the latest upstream version

Create patch files instead of sed
Fix release numbering
This commit is contained in:
Ondřej Sloup 2022-08-04 10:30:16 +02:00
parent 4b5be72cd0
commit a932804c79
5 changed files with 56 additions and 31 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/3.0.11.tar.gz
/3.0.16.tar.gz

View File

@ -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",

View File

@ -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"

View File

@ -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 <releng@fedoraproject.org> - 3.0.11-3
* Thu Aug 04 2022 Ondrej Sloup <osloup@redhat.com> - 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 <releng@fedoraproject.org> - 3.0.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 3.0.11-2
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 3.0.11-3
- Rebuilt for Python 3.11
* Fri May 13 2022 Ondrej Sloup <osloup@redhat.com> - 3.0.11-2

View File

@ -1 +1 @@
SHA512 (3.0.11.tar.gz) = dc4afbf866c274e5feabb2bf74c81a3ea17b216c82a0c75770f9699578ceb098b33b3af5ad43c3683be5123f6fd4767ab5a848ca091f4731911ac32e5409fe98
SHA512 (3.0.16.tar.gz) = 655e01bb00972dacae590f2e8ce5948226acb827b55099e7f362fdee9210f07b755f4da10d2fadd468aa95eaa3f72e7658a1ab26870d4ac159ee266ce1f8140c