Blame python-pytest-sourceorder.spec

9acbf7e
%if 0%{?rhel} && 0%{?rhel} <= 7
5706cca
%global with_python3 0
5706cca
%else
5706cca
%global with_python3 1
5706cca
%endif
5706cca
5706cca
%if 0%{?rhel} && 0%{?rhel} <= 6
5706cca
%{!?__python2: %global __python2 /usr/bin/python2}
5706cca
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
5706cca
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
5706cca
%endif
5706cca
5706cca
%global srcname pytest-sourceorder
5706cca
%global modulename pytest_sourceorder
3019823
%global srcversion 0.5
5706cca
%global versionedname %{srcname}-%{srcversion}
5706cca
5706cca
Name: python-%{srcname}
5706cca
Version: %{srcversion}
8057161
Release: 11%{?dist}
5706cca
Summary: Test-ordering plugin for pytest
5706cca
5706cca
License: GPLv3+
5706cca
URL: https://github.com/encukou/%{srcname}
5706cca
5706cca
Source0: https://github.com/encukou/%{srcname}/archive/v%{srcversion}.tar.gz#/%{versionedname}.tar.gz
5706cca
5706cca
BuildArch: noarch
d97b859
BuildRequires: python2-devel
d97b859
BuildRequires: python2-setuptools
d97b859
BuildRequires: python2-pytest
5706cca
%if 0%{?with_python3}
5706cca
BuildRequires: python3-devel
5706cca
BuildRequires: python3-setuptools
5706cca
BuildRequires: python3-pytest
5706cca
%endif
5706cca
d97b859
%description
d97b859
Allows tests within a specially marked class to be run in source order,
d97b859
instead of the "almost alphabetical" order Pytest normally uses.
d97b859
d97b859
d97b859
%package -n python2-%{srcname}
d97b859
Summary: Utility for writing multi-host tests for pytest
d97b859
d97b859
%{?python_provide:%python_provide python2-%{srcname}}
d97b859
d97b859
Requires: python2
d97b859
Requires: python2-pytest >= 2.4.0
5706cca
9acbf7e
%if 0%{?fedora} || 0%{?rhel} > 7
5706cca
# These are not *strictly* required, but are part of the default workflow.
5706cca
Requires: PyYAML
d97b859
Requires: python2-paramiko
5706cca
%endif
5706cca
5706cca
d97b859
%description -n python2-%{srcname}
5706cca
Allows tests within a specially marked class to be run in source order,
5706cca
instead of the "almost alphabetical" order Pytest normally uses.
5706cca
5706cca
%if 0%{?with_python3}
5706cca
%package -n python3-%{srcname}
5706cca
Summary: Test-ordering plugin for pytest
5706cca
d97b859
%{?python_provide:%python_provide python3-%{srcname}}
d97b859
5706cca
Requires: python3
5706cca
Requires: python3-pytest
5706cca
9acbf7e
%if 0%{?fedora} || 0%{?rhel} > 7
d97b859
# These are not *strictly* required, but are part of the default workflow.
d97b859
Recommends: python3-PyYAML
d97b859
Recommends: python3-paramiko
d97b859
%endif
d97b859
d97b859
5706cca
%description -n python3-%{srcname}
5706cca
Allows tests within a specially marked class to be run in source order,
5706cca
instead of the "almost alphabetical" order Pytest normally uses.
5706cca
5706cca
%endif
5706cca
5706cca
5706cca
%prep
5706cca
%setup -q -n %{versionedname}
5706cca
5706cca
%if 0%{?with_python3}
5706cca
echo %{py3dir}
5706cca
rm -rf %{py3dir}
5706cca
cp -a . %{py3dir}
5706cca
%endif
5706cca
5706cca
5706cca
%build
5706cca
%{__python2} setup.py build
5706cca
5706cca
%if 0%{?with_python3}
5706cca
pushd %{py3dir}
5706cca
%{__python3} setup.py build
5706cca
popd
5706cca
%endif
5706cca
5706cca
%check
5706cca
%{__python2} -m pytest
5706cca
5706cca
%if 0%{?with_python3}
5706cca
pushd %{py3dir}
5706cca
%{__python3} -m pytest
5706cca
popd
5706cca
%endif
5706cca
5706cca
%install
5706cca
%{__python2} setup.py install --skip-build --root %{buildroot}
5706cca
%if 0%{?with_python3}
5706cca
%py_byte_compile %{__python2} %{buildroot}%{python_sitelib}/%{srcname}
5706cca
%else
5706cca
# py_byte_compile is only defined in python3-devel
5706cca
%{__python2} -m compileall %{buildroot}%{python_sitelib}/%{srcname}
5706cca
%endif
5706cca
5706cca
%if 0%{?with_python3}
5706cca
pushd %{py3dir}
5706cca
%{__python3} setup.py install --skip-build --root %{buildroot}
5706cca
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/%{srcname}
5706cca
popd
5706cca
%endif
5706cca
d97b859
%files -n python2-%{srcname}
3019823
%if 0%{?rhel} && 0%{?rhel} <= 6
3019823
%doc COPYING
3019823
%else
5706cca
%license COPYING
3019823
%endif
5706cca
%doc README.rst
8ecd35f
%{python2_sitelib}/%{modulename}-%{version}-py2.?.egg-info
8ecd35f
%{python2_sitelib}/%{modulename}.py*
5706cca
5706cca
%if 0%{?with_python3}
5706cca
%files -n python3-%{srcname}
5706cca
%license COPYING
5706cca
%doc README.rst
5706cca
%{python3_sitelib}/%{modulename}-%{version}-py%{python3_version}.egg-info
5706cca
%{python3_sitelib}/%{modulename}.py
3dc99e1
%{python3_sitelib}/__pycache__/%{modulename}.*.py*
5706cca
%endif
5706cca
5706cca
5706cca
%changelog
8057161
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-11
8057161
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
8057161
4e8acf8
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.5-10
4e8acf8
- Rebuilt for Python 3.7
4e8acf8
88a87b5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-9
88a87b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
88a87b5
9acbf7e
* Tue Oct 31 2017 Troy Dawson <tdawson@redhat.com> - 0.5-8
9acbf7e
- Cleanup spec file conditionals
9acbf7e
0e05b56
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-7
0e05b56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0e05b56
d97b859
* Wed Jun 28 2017 Petr Viktorin <encukou@gmail.com> - 0.5-6
d97b859
- Rename "python-pytest-sourceorder" package to "python2-pytest-sourceorder"
d97b859
- Add Recommends: for PyYAML and Paramiko to the py3 package
d97b859
c536ca1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-5
c536ca1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c536ca1
24696d0
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.5-4
24696d0
- Rebuild for Python 3.6
24696d0
9508990
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
9508990
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9508990
9e89308
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-2
9e89308
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9e89308
3019823
* Tue Jan 26 2016 Petr Viktorin <encukou@gmail.com> - 0.5-1
3019823
- Add support for parametrized tests under Python 3
3019823
- Don't use licence macro on RHEL 6
3019823
3dc99e1
* Thu Nov 19 2015 Petr Viktorin <encukou@gmail.com> - 0.4-5
3dc99e1
- Include opt-*.pyc files in the Python 3 RPM
3dc99e1
b3484ab
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-4
b3484ab
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
b3484ab
6f7069a
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-3
6f7069a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6f7069a
5706cca
* Tue Jan 27 2015 Petr Viktorin <encukou@gmail.com> - 0.4-2
5706cca
- Also install COPYING as a license on the Python 3 version
5706cca
5706cca
* Mon Jan 26 2015 Petr Viktorin <encukou@gmail.com> - 0.4-1
5706cca
- Improve Python 3 compatibility
5706cca
- Run tests in the check step
5706cca
- Install COPYING as a license
5706cca
5706cca
* Wed Nov 26 2014 Petr Viktorin <encukou@gmail.com> - 0.3-1
5706cca
- "Upstream" packaging fixes
5706cca
5706cca
* Mon Nov 10 2014 Petr Viktorin <encukou@gmail.com> - 0.2-1
5706cca
- better extensibility
5706cca
- bug fixes
5706cca
5706cca
* Mon Nov 10 2014 Petr Viktorin <encukou@gmail.com> - 0.1-1
5706cca
- initial public version of package