Removed Python2 support

Removed python2 support from specfile.
This commit is contained in:
Matthew Davis 2022-04-07 18:46:22 -04:00
commit 23b0bafb53

View file

@ -1,10 +1,4 @@
%global srcname pyRFC3339
%if 0%{?rhel} && (0%{?rhel} <= 7)
%bcond_without python2
%else
%bcond_with python2
%endif
%global py3_prefix python%{python3_pkgversion}
Name: python-pyrfc3339
@ -21,13 +15,6 @@ Source0: %{pypi_source}
Source1: https://raw.githubusercontent.com/kurtraschke/pyRFC3339/e30cc1555adce0ecc7bd65509a2249d47e5a41b4/pyrfc3339/tests/tests.py
BuildArch: noarch
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python-setuptools
# --- unit tests ---
BuildRequires: pytest
BuildRequires: pytz
%endif
BuildRequires: %{py3_prefix}-devel
BuildRequires: %{py3_prefix}-setuptools
@ -39,16 +26,6 @@ BuildRequires: %{py3_prefix}-pytz
This package contains a python library to parse and generate
RFC 3339-compliant timestamps using Python datetime.datetime objects.
%if %{with python2}
%package -n python2-pyrfc3339
Summary: %{summary}
%{?python_provide:%python_provide python2-pyrfc3339}
%description -n python2-pyrfc3339
This package contains a Python 2 library to parse and generate
RFC 3339-compliant timestamps using Python datetime.datetime objects.
%endif
%package -n %{py3_prefix}-pyrfc3339
Summary: Generate and parse RFC 3339 timestamps
%{?python_provide:%python_provide python3-pyrfc3339}
@ -63,33 +40,14 @@ RFC 3339-compliant timestamps using Python datetime.datetime objects.
%autosetup -n %{srcname}-%{version}
%build
%if %{with python2}
%py2_build
%endif
%py3_build
%install
%if %{with python2}
%py2_install
%endif
%py3_install
%check
cp -a %{SOURCE1} .
%if %{with python2}
py.test-2.7 -v tests.py
pytest-3 -v tests.py
%else
%pytest -v tests.py
%endif
%if %{with python2}
%files -n python2-pyrfc3339
%doc README.rst
%license LICENSE.txt
%{python2_sitelib}/pyrfc3339
%{python2_sitelib}/%{srcname}-%{version}-*.egg-info
%endif
%files -n %{py3_prefix}-pyrfc3339
%doc README.rst
@ -99,7 +57,7 @@ pytest-3 -v tests.py
%changelog
* Fri Jan 28 2022 Matthew Davis <fedoraproject@virtual.drop.net> - 1.1-11
* Thu Apr 07 2022 Matthew Davis <fedoraproject@virtual.drop.net> - 1.1-11
- Converted tests from python-nose to pytest
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-10