From 655a776a72048092cb31a4956597afc77b0dedd4 Mon Sep 17 00:00:00 2001 From: rdobuilder Date: Jan 22 2024 08:18:49 +0000 Subject: Update to 2.9.9 Related-to: https://review.rdoproject.org/r/q/I8a2670b27443f9646abe344cc4b470021a67f886 --- diff --git a/.python-psycopg2.metadata b/.python-psycopg2.metadata index 93c132d..e2a75d4 100644 --- a/.python-psycopg2.metadata +++ b/.python-psycopg2.metadata @@ -1 +1 @@ -4f77e3efcf9a0970be5120352274315f7bd1c754 SOURCES/psycopg2-2.7.5.tar.gz +eb05a19f9fd0934801122fcf065767835555e8a5 SOURCES/psycopg2-2.9.9.tar.gz diff --git a/SOURCES/test_types_extras-2.9.3-test_from_tables.patch b/SOURCES/test_types_extras-2.9.3-test_from_tables.patch new file mode 100644 index 0000000..750e479 --- /dev/null +++ b/SOURCES/test_types_extras-2.9.3-test_from_tables.patch @@ -0,0 +1,54 @@ +--- tests/test_types_extras.py-orig 2021-12-29 13:51:56.000000000 +0100 ++++ tests/test_types_extras.py 2022-05-17 11:23:12.476001589 +0200 +@@ -616,51 +616,6 @@ + curs.execute("select (1,2)::type_ii") + self.assertRaises(psycopg2.DataError, curs.fetchone) + +- @slow +- @skip_if_no_composite +- @skip_before_postgres(8, 4) +- def test_from_tables(self): +- curs = self.conn.cursor() +- curs.execute("""create table ctest1 ( +- id integer primary key, +- temp int, +- label varchar +- );""") +- +- curs.execute("""alter table ctest1 drop temp;""") +- +- curs.execute("""create table ctest2 ( +- id serial primary key, +- label varchar, +- test_id integer references ctest1(id) +- );""") +- +- curs.execute("""insert into ctest1 (id, label) values +- (1, 'test1'), +- (2, 'test2');""") +- curs.execute("""insert into ctest2 (label, test_id) values +- ('testa', 1), +- ('testb', 1), +- ('testc', 2), +- ('testd', 2);""") +- +- psycopg2.extras.register_composite("ctest1", curs) +- psycopg2.extras.register_composite("ctest2", curs) +- +- curs.execute(""" +- select ctest1, array_agg(ctest2) as test2s +- from ( +- select ctest1, ctest2 +- from ctest1 inner join ctest2 on ctest1.id = ctest2.test_id +- order by ctest1.id, ctest2.label +- ) x group by ctest1;""") +- +- r = curs.fetchone() +- self.assertEqual(r[0], (1, 'test1')) +- self.assertEqual(r[1], [(1, 'testa', 1), (2, 'testb', 1)]) +- r = curs.fetchone() +- self.assertEqual(r[0], (2, 'test2')) +- self.assertEqual(r[1], [(3, 'testc', 2), (4, 'testd', 2)]) + + @skip_if_no_composite + def test_non_dbapi_connection(self): diff --git a/SPECS/python-psycopg2.spec b/SPECS/python-psycopg2.spec index bbd3840..8212b6f 100644 --- a/SPECS/python-psycopg2.spec +++ b/SPECS/python-psycopg2.spec @@ -1,22 +1,28 @@ %if 0%{?fedora} - %bcond_without python3 - %if 0%{?fedora} > 29 - %bcond_with python2 - %else - %bcond_without python2 - %endif + %bcond_without python3 + %bcond_without python3_debug + %if 0%{?fedora} > 31 + %bcond_with python2 + %bcond_with python2_debug + %else + %bcond_without python2 + %bcond_without python2_debug + %endif %else - %if 0%{?rhel} > 7 - %bcond_with python2 - %bcond_without python3 - %else - %bcond_without python2 - %bcond_with python3 - %endif + %if 0%{?rhel} > 7 + %bcond_with python2 + %bcond_without python3 + %bcond_with python2_debug + %bcond_without python3_debug + %else + %bcond_without python2 + %bcond_with python3 + %bcond_without python2_debug + %bcond_with python3_debug + %endif %endif -%bcond_without check -%bcond_with debugrpms +%bcond_without tests %global srcname psycopg2 %global sum A PostgreSQL database adapter for Python @@ -25,8 +31,11 @@ programming language. At its core it fully implements the Python DB \ API 2.0 specifications. Several extensions allow access to many of the \ features offered by PostgreSQL. -%global python_runtimes %{?with_python2:python2 %{?with_debugrpms:python2-debug}} \\\ - %{?with_python3:python3 %{?with_debugrpms:python3-debug}} +%global python_runtimes \\\ + %{?with_python2:python2} \\\ + %{?with_python2_debug:python2-debug} \\\ + %{?with_python3:python3} \\\ + %{?with_python3_debug:python3-debug} %{!?with_python2:%{!?with_python3:%{error:one python version needed}}} @@ -40,28 +49,34 @@ features offered by PostgreSQL. Summary: %{sum} Name: python-%{srcname} -Version: 2.7.5 -Release: 7%{?dist} +Version: 2.9.9 +Release: 2%{?dist} # The exceptions allow linking to OpenSSL and PostgreSQL's libpq -License: LGPLv3+ with exceptions -Group: Applications/Databases -Url: http://www.psycopg.org/psycopg/ +License: LGPL-3.0-or-later WITH openvpn-openssl-exception +Url: https://www.psycopg.org/ -Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-%{version}.tar.gz +Source0: https://github.com/psycopg/psycopg2/archive/%{version}/psycopg2-%{version}.tar.gz -%{?with_python2:BuildRequires: %{?with_debugrpms:/usr/bin/python2-debug} python2-devel} -%{?with_python3:BuildRequires: %{?with_debugrpms:/usr/bin/python3-debug} python3-devel} +%{?with_python2:BuildRequires: python2-devel python2-setuptools} +%{?with_python3:BuildRequires: python3-devel python3-setuptools} +%{?with_python2_debug:BuildRequires: python2-debug} +%{?with_python3_debug:BuildRequires: python3-debug} -BuildRequires: gcc -BuildRequires: pkgconfig(libpq) +BuildRequires: gcc +BuildRequires: libpq-devel +BuildRequires: python-sphinx # For testsuite -%if %{with check} +%if %{with tests} BuildRequires: postgresql-test-rpm-macros %endif Conflicts: python-psycopg2-zope < %{version} +# Remove test 'test_from_tables' for s390 architecture +# from ./tests/test_types_extras.py +Patch0: test_types_extras-2.9.3-test_from_tables.patch + %description %{desc} @@ -82,9 +97,10 @@ Requires: python2-%srcname = %version-%release %description -n python2-%{srcname}-tests %desc This sub-package delivers set of tests for the adapter. +%endif -%if %{with debugrpms} +%if %{with python2_debug} %package -n python2-%{srcname}-debug Summary: A PostgreSQL database adapter for Python 2 (debug build) # Require the base package, as we're sharing .py/.pyc files: @@ -94,8 +110,7 @@ Requires: python2-%{srcname} = %{version}-%{release} %description -n python2-%{srcname}-debug This is a build of the psycopg PostgreSQL database adapter for the debug build of Python 2. -%endif # debugrpms -%endif # python2 +%endif %if %{with python3} @@ -108,15 +123,16 @@ Summary: %{sum} 3 %package -n python3-%{srcname}-tests -Summary: A testsuite for %sum 2 +Summary: A testsuite for %sum 3 Requires: python3-%srcname = %version-%release %description -n python3-%{srcname}-tests %desc This sub-package delivers set of tests for the adapter. +%endif -%if %{with debugrpms} +%if %{with python3_debug} %package -n python3-psycopg2-debug Summary: A PostgreSQL database adapter for Python 3 (debug build) # Require base python 3 package, as we're sharing .py/.pyc files: @@ -125,13 +141,11 @@ Requires: python3-psycopg2 = %{version}-%{release} %description -n python3-%{srcname}-debug This is a build of the psycopg PostgreSQL database adapter for the debug build of Python 3. -%endif # debugrpms -%endif # python3 +%endif %package doc Summary: Documentation for psycopg python PostgreSQL database adapter -Group: Documentation %{?with_python2:Provides: python2-%{srcname}-doc = %{version}-%{release}} %{?with_python3:Provides: python3-%{srcname}-doc = %{version}-%{release}} @@ -145,7 +159,6 @@ database adapter. Summary: Zope Database Adapter ZPsycopgDA # The exceptions allow linking to OpenSSL and PostgreSQL's libpq License: GPLv2+ with exceptions or ZPLv1.0 -Group: Applications/Databases Requires: %{name} = %{version}-%{release} Requires: zope @@ -155,8 +168,13 @@ Zope Database Adapter for PostgreSQL, called ZPsycopgDA %prep -%autosetup -p1 -n psycopg2-%{version} +%setup -q -n psycopg2-%{version} +# The patch is applied only for s390 architecture as +# on other architectures the test works +%ifarch s390x s390 +%patch0 -p0 +%endif %build export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS} @@ -169,15 +187,21 @@ for i in `find doc -iname "*.html"`; do sed -i 's/\r//' $i; done for i in `find doc -iname "*.css"`; do sed -i 's/\r//' $i; done # Get rid of a "hidden" file that rpmlint complains about -rm -f doc/html/.buildinfo +%{__rm} -f doc/html/.buildinfo # We can not build docs now: # https://www.postgresql.org/message-id/2741387.dvL6Cb0VMB@nb.usersys.redhat.com -# make -C doc/src html +# as the bug was sorted, we can build the documentation again + +# Remove design formatting package +sed -i '/better_theme_path/d' doc/src/conf.py +sed -i "/html_theme = 'better'/d" doc/src/conf.py + +make html -C doc/src %check -%if %{with check} +%if %{with tests} export PGTESTS_LOCALE=C.UTF-8 %postgresql_tests_run @@ -185,7 +209,7 @@ export PSYCOPG2_TESTDB=${PGTESTS_DATABASES##*:} export PSYCOPG2_TESTDB_HOST=$PGHOST export PSYCOPG2_TESTDB_PORT=$PGPORT -cmd="from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')" +cmd="import tests; tests.unittest.main(defaultTest='tests.test_suite')" %if %{with python2} PYTHONPATH=%buildroot%python2_sitearch %__python2 -c "$cmd" --verbose @@ -193,7 +217,7 @@ PYTHONPATH=%buildroot%python2_sitearch %__python2 -c "$cmd" --verbose %if %{with python3} PYTHONPATH=%buildroot%python3_sitearch %__python3 -c "$cmd" --verbose %endif -%endif # check +%endif %install @@ -202,13 +226,24 @@ for python in %{python_runtimes} ; do $python setup.py install --no-compile --root %{buildroot} done -%if %zope -install -d %{buildroot}%{ZPsycopgDAdir} -cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} +# Upstream removed tests from the package so we need to add them manually +%if %{with python2} +cp -r tests/ %{buildroot}%{python2_sitearch}/%{srcname}/tests/ +for i in `find %{buildroot}%{python2_sitearch}/%{srcname}/tests/ -iname "*.py"`; do + sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' $i +done +%endif +%if %{with python3} +cp -r tests/ %{buildroot}%{python3_sitearch}/%{srcname}/tests/ +for i in `find %{buildroot}%{python3_sitearch}/%{srcname}/tests/ -iname "*.py"`; do + sed -i 's|#!/usr/bin/env python|#!/usr/bin/python3|' $i +done %endif -# This test is skipped on 3.7 and has a syntax error so brp-python-bytecompile would choke on it -%{?with_python3:rm -r %{buildroot}%{python3_sitearch}/%{srcname}/tests/test_async_keyword.py} +%if %zope +%{__install} -d %{buildroot}%{ZPsycopgDAdir} +%{__cp} -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} +%endif %if %{with python2} %files -n python2-psycopg2 @@ -224,14 +259,14 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %files -n python2-%{srcname}-tests %{python2_sitearch}/psycopg2/tests +%endif -%if %{with debugrpms} +%if %{with python2_debug} %files -n python2-%{srcname}-debug %license LICENSE %{python2_sitearch}/psycopg2/_psycopg_d.so -%endif # debugrpms -%endif # python2 +%endif %if %{with python3} @@ -240,7 +275,7 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %doc AUTHORS NEWS README.rst %dir %{python3_sitearch}/psycopg2 %{python3_sitearch}/psycopg2/*.py -%{python3_sitearch}/psycopg2/_psycopg.cpython-3?m*.so +%{python3_sitearch}/psycopg2/_psycopg.cpython-%{python3_version_nodots}[!d]*.so %dir %{python3_sitearch}/psycopg2/__pycache__ %{python3_sitearch}/psycopg2/__pycache__/*.py{c,o} %{python3_sitearch}/psycopg2-%{version}-py3*.egg-info @@ -248,19 +283,19 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %files -n python3-%{srcname}-tests %{python3_sitearch}/psycopg2/tests +%endif -%if %{with debugrpms} +%if %{with python3_debug} %files -n python3-psycopg2-debug %license LICENSE -%{python3_sitearch}/psycopg2/_psycopg.cpython-3?dm*.so -%endif # debugrpms -%endif # python3 +%{python3_sitearch}/psycopg2/_psycopg.cpython-%{python3_version_nodots}d*.so +%endif %files doc %license LICENSE -%doc doc examples/ +%doc doc/src/_build/html %if %zope @@ -276,39 +311,140 @@ cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} %changelog -* Fri Oct 05 2018 Pavel Raiskup - 2.7.5-7 -- bump the NVR to beat the NVR from module +* Tue Jan 16 2024 Miro Hrončok - 2.9.9-2 +- Fix URL and Source URL + +* Mon Dec 11 2023 Ondrej Sloup - 2.9.9-1 +- Rebase to the latest upstream version + +* Fri Nov 03 2023 Ondrej Sloup - 2.9.6-4 +- Update license and use SPDX formula according to fedora-license-data +- https://gitlab.com/fedora/legal/fedora-license-data/-/issues/153 + +* Fri Jul 21 2023 Fedora Release Engineering - 2.9.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jun 14 2023 Python Maint - 2.9.6-2 +- Rebuilt for Python 3.12 + +* Fri May 05 2023 Ondrej Sloup - 2.9.6-1 +- Rebase to the latest upstream version +- Resolves rhbz#2171683 + +* Fri Jan 20 2023 Fedora Release Engineering - 2.9.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 2.9.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 14 2022 Filip Janus - 2.9.3-5 +- Build directly with libpq-devel + +* Mon Jun 13 2022 Python Maint - 2.9.3-4 +- Rebuilt for Python 3.11 + +* Fri May 13 2022 Ondrej Sloup - 2.9.3-3 +- Remove test test_from_tables failing on s390x +- Make docs + +* Fri Jan 21 2022 Fedora Release Engineering - 2.9.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jan 7 2022 Devrim Gündüz - 2.9.3-1 +- Update to 2.9.3 + +* Tue Aug 03 2021 Filip Januš - 2.9.1-1 +- Update to 2.9.1 + +* Fri Jul 23 2021 Fedora Release Engineering - 2.8.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jun 03 2021 Python Maint - 2.8.6-4 +- Rebuilt for Python 3.10 + +* Mon Feb 08 2021 Pavel Raiskup - 2.8.6-3 +- rebuild for libpq ABI fix rhbz#1908268 + +* Wed Jan 27 2021 Fedora Release Engineering - 2.8.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Sep 17 2020 Patrik Novotný - 2.8.6-1 +- Rebase to upstream version 2.8.6 + +* Wed Jul 29 2020 Fedora Release Engineering - 2.8.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat May 23 2020 Miro Hrončok - 2.8.5-2 +- Rebuilt for Python 3.9 + +* Tue Apr 21 2020 Patrik Novotný - 2.8.5-1 +- Rebase to upstream version 2.8.5 + +* Thu Jan 30 2020 Fedora Release Engineering - 2.8.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Nov 06 2019 Lumír Balhar - 2.8.4-1 +- New upstream version 2.8.4 +- bcond check renamed to bcond tests + +* Sun Oct 20 2019 Miro Hrončok - 2.8.3-2 +- Package python2-psycopg2 removed on Fedora 32+ (rhbz#1761216) + +* Mon Sep 09 2019 Devrim Gündüz - 2.8.3-1 +- Update to 2.8.3 + +* Mon Sep 09 2019 Miro Hrončok - 2.7.7-5 +- Package python2-psycopg2-debug removed on Fedora 32+ (rhbz#1747670) + +* Fri Aug 16 2019 Miro Hrončok - 2.7.7-4 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 2.7.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue May 14 2019 Miro Hrončok - 2.7.7-2 +- Fixes for 3.8.0a4 rebuild + Resolves: 1693641 + +* Tue Feb 05 2019 Pavel Raiskup - 2.7.7-1 +- update to the latest upstream release + +* Sat Feb 02 2019 Fedora Release Engineering - 2.7.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Wed Oct 03 2018 Pavel Raiskup - 2.7.5-5 -- sync with Fedora Rawide +- prepare --without=debugrpms option (rhbz#1635166) +- get the python2 packages back for a while (rhbz#1634973) -* Thu Aug 02 2018 Pavel Raiskup - 2.7.5-4 -- re-enable testsuite +* Wed Oct 03 2018 Pavel Raiskup - 2.7.5-4 +- drop python2* on f30+ (rhbz#1634973) +- use proper compiler/linker flags (rhbz#1631713) +- correct the (build)requires -* Wed Aug 01 2018 Lumír Balhar - 2.7.5-3 -- Disable failing tests +* Tue Jul 17 2018 Pavel Raiskup - 2.7.5-3 +- standalone installable doc subpackage -* Wed Jul 18 2018 Tomas Orsava - 2.7.5-2 -- BuildRequire also python36-rpm-macros as part of the python36 module build +* Sat Jul 14 2018 Fedora Release Engineering - 2.7.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild -* Tue Jul 17 2018 Pavel Raiskup - 2.7.5-1 -- sync with fedora rawhide +* Mon Jul 02 2018 Miro Hrončok - 2.7.5-2 +- Rebuilt for Python 3.7 -* Tue May 01 2018 Tomas Orsava - 2.7.4-5 -- Let the doc subpackage be standalone installable +* Mon Jun 18 2018 Pavel Raiskup - 2.7.5-1 +- rebase to latest upstream release, per release notes: + http://initd.org/psycopg/articles/2018/06/17/psycopg-275-released/ + +* Sat Jun 16 2018 Miro Hrončok - 2.7.4-5 +- Rebuilt for Python 3.7 -* Wed Apr 25 2018 Tomas Orsava - 2.7.4-4 -- Make requires on python36-devel/debug dependant on a python36_module bcond +* Mon May 21 2018 Pavel Raiskup - 2.7.4-4 +- fix for python 3.7, by mhroncok -* Mon Apr 23 2018 Tomas Orsava - 2.7.4-3 -- Revert switching Python 3 subpackages to the python3X- prefix -- Switch only the requires for python3-devel/debug to the python36-prefix: - the rest of the packages in the python36 collection will have the python3 - prefix to be unified with the Python 3 packages for Platform-Python +* Fri Apr 13 2018 Pavel Raiskup - 2.7.4-3 +- depend on postgresql-test-rpm-macros -* Wed Apr 18 2018 Tomas Orsava - 2.7.4-2 -- Switch the Python 3 subpackages to the python3X- prefix using - the %{python3_pkgversion} macro +* Fri Apr 13 2018 Pavel Raiskup - 2.7.4-2 +- re-enable testsuite * Mon Feb 12 2018 Pavel Raiskup - 2.7.4-1 - rebase to latest upstream release, per release notes: