epel7 specific, python3 build

This commit is contained in:
Jeremy Bertozzi 2019-10-29 14:54:23 +01:00
commit 516a6af5f1

View file

@ -1,16 +1,14 @@
%global pypi_name packaging
%if 0%{?fedora}
%global build_wheel 1
%global with_python3 1
%endif
%global python2_wheelname %{pypi_name}-%{version}-py2.py3-none-any.whl
%global python3_wheelname %python2_wheelname
Name: python-%{pypi_name}
Version: 16.8
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Core utilities for Python packages
License: BSD or ASL 2.0
@ -18,24 +16,15 @@ URL: https://github.com/pypa/packaging
Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
# Dependencies with different names in Fedora and Epel7
%if 0%{?fedora}
BuildRequires: python2-setuptools
BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-pyparsing
%else
BuildRequires: python-setuptools
BuildRequires: python-devel
BuildRequires: pytest
BuildRequires: pyparsing
BuildRequires: python-sphinx
%endif
BuildRequires: python-pretend
BuildRequires: python-six
# Build Python 3 subpackage only for Fedora
# Build Python 3 subpackage
%if 0%{?with_python3}
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-devel
@ -63,12 +52,7 @@ dealing with versions, specifiers, markers etc.
Summary: %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}
%if 0%{?fedora}
Requires: python2-pyparsing
%else
Requires: pyparsing
%endif
Requires: python-six
%description -n python2-%{pypi_name}
@ -114,7 +98,7 @@ rm -rf %{pypi_name}.egg-info
# generate html docs
%if 0%{?with_python3}
sphinx-build-3 docs html
sphinx-build-%{python3_version} docs html
%else
sphinx-build docs html
%endif
@ -140,13 +124,9 @@ rm -rf html/_static/fonts/
%endif
%check
%if 0%{?fedora}
%{__python2} -m pytest tests/
%{__python3} -m pytest tests/
%else
# Disable non-working tests in Epel7
%{__python2} -m pytest --ignore=tests/test_requirements.py tests/
%endif
%{__python3} -m pytest --ignore=tests/test_requirements.py tests/
%files -n python2-%{pypi_name}
%license LICENSE LICENSE.APACHE LICENSE.BSD
@ -167,6 +147,10 @@ rm -rf html/_static/fonts/
%license LICENSE LICENSE.APACHE LICENSE.BSD
%changelog
* Thu Oct 29 2019 Jérémy Bertozzi <jeremy.bertozzi@gmail.com> - 16.8-6
- epel7 specific spec file
- python3 package for epel7
* Wed Mar 22 2017 Lumir Balhar <lbalhar@redhat.com> - 16.8-5
- Epel7 compatible spec/package