drop Python 2.x support

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
This commit is contained in:
Nils Philippsen 2021-05-10 14:47:06 +02:00
parent 13682078c4
commit e90a627871
1 changed files with 1 additions and 75 deletions

View File

@ -1,17 +1,3 @@
# Don't build Python 3 package on all EL <= 7
%if !0%{?rhel} || 0%{?rhel} > 7
%bcond_without python3
%else
%bcond_with python3
%endif
# Build Python 2 package on all Fedora < 32, EL < 9
%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 32 || 0%{?rhel} >= 9
%bcond_with python2
%else
%bcond_without python2
%endif
# when bootstrapping Python, pytest-xdist is not yet available # when bootstrapping Python, pytest-xdist is not yet available
%bcond_without xdist %bcond_without xdist
@ -29,14 +15,6 @@ URL: http://www.sqlalchemy.org/
Source0: https://files.pythonhosted.org/packages/source/S/%{srcname}/%{srcname}-%{srcversion}.tar.gz Source0: https://files.pythonhosted.org/packages/source/S/%{srcname}/%{srcname}-%{srcversion}.tar.gz
BuildRequires: gcc BuildRequires: gcc
%if %{with python2}
BuildRequires: python2-devel >= 2.6
BuildRequires: python2-setuptools
BuildRequires: python2-mock
BuildRequires: python2-pytest
%endif
%if %{with python3}
BuildRequires: python3-devel >= 3.6 BuildRequires: python3-devel >= 3.6
BuildRequires: python3-greenlet >= 1.0 BuildRequires: python3-greenlet >= 1.0
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
@ -45,7 +23,6 @@ BuildRequires: python3-pytest
%if %{with xdist} %if %{with xdist}
BuildRequires: python3-pytest-xdist BuildRequires: python3-pytest-xdist
%endif %endif
%endif
%description %description
SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible,
@ -65,31 +42,10 @@ BuildArch: noarch
%description doc %description doc
Documentation for SQLAlchemy Documentation for SQLAlchemy
%if %{with python2}
%package -n python2-sqlalchemy
Summary: Modular and flexible ORM library for python
%{?python_provide:%python_provide python2-sqlalchemy}
%description -n python2-sqlalchemy
SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible,
high-level interface to SQL databases. Database and domain concepts are
decoupled, allowing both sides maximum flexibility and power. SQLAlchemy
provides a powerful mapping layer that can work as automatically or as manually
as you choose, determining relationships based on foreign keys or letting you
define the join conditions explicitly, to bridge the gap between database and
domain.
This package includes the python 2 version of the module.
%endif
# with python2
%if %{with python3}
%package -n python3-sqlalchemy %package -n python3-sqlalchemy
Summary: Modular and flexible ORM library for python Summary: Modular and flexible ORM library for python
%{?python_provide:%python_provide python%{python3_pkgversion}-sqlalchemy} %{?python_provide:%python_provide python%{python3_pkgversion}-sqlalchemy}
%if ! %{with python2}
Obsoletes: python2-sqlalchemy < 1.3.10-2 Obsoletes: python2-sqlalchemy < 1.3.10-2
%endif
%description -n python3-sqlalchemy %description -n python3-sqlalchemy
SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible,
@ -101,8 +57,6 @@ define the join conditions explicitly, to bridge the gap between database and
domain. domain.
This package includes the python 3 version of the module. This package includes the python 3 version of the module.
%endif
# with python3
%prep %prep
@ -113,61 +67,33 @@ This package includes the python 3 version of the module.
sed -i -e's/\(addopts = .*\) --max-worker-restart=5/\1/' setup.cfg sed -i -e's/\(addopts = .*\) --max-worker-restart=5/\1/' setup.cfg
%build %build
%if %{with python2}
%py2_build
%endif
%if %{with python3}
%py3_build %py3_build
%endif
%install %install
%if %{with python2}
%py2_install
%endif
%if %{with python3}
%py3_install %py3_install
%endif
# remove unnecessary scripts for building documentation # remove unnecessary scripts for building documentation
rm -rf doc/build rm -rf doc/build
%check %check
%if %{with python2}
PYTHONPATH=. %{__python2} -m pytest test
%endif
%if %{with python3}
PYTHONPATH=. %{__python3} -m pytest test \ PYTHONPATH=. %{__python3} -m pytest test \
%if %{with xdist} %if %{with xdist}
--numprocesses=auto --numprocesses=auto
%endif %endif
%endif
%files doc %files doc
%doc doc examples %doc doc examples
%if %{with python2}
%files -n python2-sqlalchemy
%license LICENSE
%doc README.rst
%{python2_sitearch}/*
%endif
# with python2
%if %{with python3}
%files -n python3-sqlalchemy %files -n python3-sqlalchemy
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python3_sitearch}/* %{python3_sitearch}/*
%endif
# with python3
%changelog %changelog
* Mon May 10 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.14-1 * Mon May 10 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.14-1
- version 1.4.14 - version 1.4.14
- drop Python 2.x support
* Fri Apr 30 2021 Tomas Hrnciar <thrnciar@redhat.com> - 1.3.22-3 * Fri Apr 30 2021 Tomas Hrnciar <thrnciar@redhat.com> - 1.3.22-3
- Disabled failing test test_pyodbc_extra_connect_azure - Disabled failing test test_pyodbc_extra_connect_azure