Update to 2.9.1.

- Packaging updates.
This commit is contained in:
Thomas Moschny 2016-04-10 01:49:26 +02:00
parent fffc79af77
commit c65fe992d9
2 changed files with 62 additions and 94 deletions

View File

@ -1,107 +1,84 @@
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
%if 0%{?fedora}
%global with_python3 1
%endif
%global pylib_version 1.4.29 %global pylib_version 1.4.29
Name: pytest Name: pytest
Version: 2.8.7 Version: 2.9.1
Release: 2%{?dist} Release: 1%{?dist}
Summary: Simple powerful testing with Python Summary: Simple powerful testing with Python
Group: Development/Languages
License: MIT License: MIT
URL: http://pytest.org URL: http://pytest.org
Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools
Requires: python-setuptools
BuildRequires: python-py >= %{pylib_version}
Requires: python-py >= %{pylib_version}
%if 0%{?rhel} > 6 || 0%{?fedora}
BuildRequires: python-sphinx
%else
BuildRequires: python-sphinx10
%endif # fedora
BuildRequires: python-docutils
%if 0%{?with_python3}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python2-setuptools
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python2-py >= %{pylib_version}
BuildRequires: python3-py >= %{pylib_version} BuildRequires: python3-py >= %{pylib_version}
%endif # with_python3 BuildRequires: python-sphinx
# pytest was separated from pylib at that point BuildRequires: python-docutils
Conflicts: python-py < 1.4.0
# used by the testsuite, if present: # used by the testsuite, if present:
%if 0%{?fedora} BuildRequires: python2-pexpect
BuildRequires: python-pexpect
BuildRequires: python-mock
BuildRequires: python-twisted-core
%if 0%{?with_python3}
BuildRequires: python3-pexpect BuildRequires: python3-pexpect
BuildRequires: python-mock
BuildRequires: python3-mock BuildRequires: python3-mock
%endif # with_python3 BuildRequires: python-twisted-core
%endif # fedora #BuildRequires: python3-twisted-core
Provides: python2-%{name} = %{version}-%{release}
%{?python_provide:%python_provide python2-%{name}}
%description %description
py.test provides simple, yet powerful testing for Python. py.test provides simple, yet powerful testing for Python.
%if 0%{?with_python3} %package -n python2-%{name}
%package -n python3-pytest Summary: Simple powerful testing with Python
Requires: python2-setuptools
Requires: python2-py >= %{pylib_version}
%{?python_provide:%python_provide python2-%{name}}
# the python2 package was named pytest up to 2.8.7-2
Provides: %{name} = %{version}-%{release}
Obsoletes: %{name} < 2.8.7-3
%description -n python2-%{name}
py.test provides simple, yet powerful testing for Python.
%package -n python3-%{name}
Summary: Simple powerful testing with Python Summary: Simple powerful testing with Python
Group: Development/Languages Group: Development/Languages
Requires: python3-setuptools Requires: python3-setuptools
Requires: python3-py >= %{pylib_version} Requires: python3-py >= %{pylib_version}
%{?python_provide:%python_provide python3-%{name}} %{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
%description -n python3-pytest
py.test provides simple, yet powerful testing for Python. py.test provides simple, yet powerful testing for Python.
%endif # with_python3
%prep %prep
%setup -qc -n %{name}-%{version} %setup -qc -n %{name}-%{version}
mv %{name}-%{version} python2 mv %{name}-%{version} python2
%if 0%{?with_python3}
cp -a python2 python3 cp -a python2 python3
%endif # with_python3
%build %build
pushd python2 pushd python2
%{py2_build} %{py2_build}
%if 0%{?rhel} > 6 || 0%{?fedora}
for l in doc/* ; do for l in doc/* ; do
make -C $l html PYTHONPATH=$(pwd) make -C $l html PYTHONPATH=$(pwd)
done done
%else for f in README CHANGELOG CONTRIBUTING ; do
for l in doc/* ; do rst2html ${f}.rst > ${f}.html
make -C $l html SPHINXBUILD=sphinx-1.0-build PYTHONPATH=$(pwd)
done done
%endif # fedora
popd popd
%if 0%{?with_python3}
pushd python3 pushd python3
%{py3_build} %{py3_build}
for l in doc/* ; do
make -C $l html PYTHONPATH=$(pwd)
done
for f in README CHANGELOG CONTRIBUTING ; do
rst2html ${f}.rst > ${f}.html
done
popd popd
%endif # with_python3
%install %install
@ -109,9 +86,17 @@ pushd python2
%{py2_install} %{py2_install}
ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test-2 ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test-2
# remove shebangs from all scripts mkdir -p _htmldocs/html
find %{buildroot}%{python2_sitelib} -name '*.py' \ for l in doc/* ; do
-exec sed -i -e '1{/^#!/d}' {} \; # remove hidden file
rm ${l}/_build/html/.buildinfo
mv ${l}/_build/html _htmldocs/html/${l##doc/}
done
popd
pushd python3
%{py3_install}
ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test-3
mkdir -p _htmldocs/html mkdir -p _htmldocs/html
for l in doc/* ; do for l in doc/* ; do
@ -119,22 +104,14 @@ for l in doc/* ; do
rm ${l}/_build/html/.buildinfo rm ${l}/_build/html/.buildinfo
mv ${l}/_build/html _htmldocs/html/${l##doc/} mv ${l}/_build/html _htmldocs/html/${l##doc/}
done done
rst2html README.rst > README.html
popd popd
%if 0%{?with_python3}
pushd python3
%{py3_install}
ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test-3
# remove shebangs from all scripts # remove shebangs from all scripts
find %{buildroot}%{python3_sitelib} -name '*.py' \ find %{buildroot}%{python2_sitelib} \
%{buildroot}%{python3_sitelib} \
-name '*.py' \
-exec sed -i -e '1{/^#!/d}' {} \; -exec sed -i -e '1{/^#!/d}' {} \;
popd
%endif # with_python3
# use 2.X per default # use 2.X per default
ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test
@ -146,51 +123,42 @@ PYTHONPATH=%{buildroot}%{python2_sitelib} \
%{buildroot}%{_bindir}/py.test-%{python2_version} -r s testing %{buildroot}%{_bindir}/py.test-%{python2_version} -r s testing
popd popd
%if 0%{?with_python3}
pushd python3 pushd python3
PATH=%{buildroot}%{_bindir}:${PATH} \ PATH=%{buildroot}%{_bindir}:${PATH} \
PYTHONPATH=%{buildroot}%{python3_sitelib} \ PYTHONPATH=%{buildroot}%{python3_sitelib} \
%{buildroot}%{_bindir}/py.test-%{python3_version} -r s testing %{buildroot}%{_bindir}/py.test-%{python3_version} -r s testing
popd popd
%endif # with_python3
%files %files -n python2-%{name}
%doc python2/CHANGELOG %doc python2/CHANGELOG.html
%doc python2/README.html %doc python2/README.html
%doc python2/CONTRIBUTING.html
%doc python2/_htmldocs/html %doc python2/_htmldocs/html
%if 0%{?_licensedir:1}
%license python2/LICENSE %license python2/LICENSE
%else
%doc python2/LICENSE
%endif # licensedir
%{_bindir}/py.test %{_bindir}/py.test
%{_bindir}/py.test-2 %{_bindir}/py.test-2
%{_bindir}/py.test-%{python2_version} %{_bindir}/py.test-%{python2_version}
%{python2_sitelib}/* %{python2_sitelib}/*
%if 0%{?with_python3} %files -n python3-%{name}
%files -n python3-pytest %doc python3/CHANGELOG.html
%doc python3/CHANGELOG %doc python3/README.html
# HTML docs generated with Python2 for now %doc python3/CONTRIBUTING.html
%doc python2/README.html %doc python3/_htmldocs/html
%doc python2/_htmldocs/html
%if 0%{?_licensedir:1}
%license python3/LICENSE %license python3/LICENSE
%else
%doc python3/LICENSE
%endif # licensedir
%{_bindir}/py.test-3 %{_bindir}/py.test-3
%{_bindir}/py.test-%{python3_version} %{_bindir}/py.test-%{python3_version}
%{python3_sitelib}/_pytest/ %{python3_sitelib}/*
%{python3_sitelib}/pytest.py %exclude %dir %{python3_sitelib}/__pycache__
%{python3_sitelib}/pytest-*.egg-info/
%{python3_sitelib}/__pycache__/*
%endif # with_python3
%changelog %changelog
* Sat Apr 9 2016 Thomas Moschny <thomas.moschny@gmx.de> - 2.9.1-1
- Update to 2.9.1.
- Packaging updates.
* Tue Feb 2 2016 Orion Poplawski <orion@cora.nwra.com> - 2.8.7-2 * Tue Feb 2 2016 Orion Poplawski <orion@cora.nwra.com> - 2.8.7-2
- Use new python macros - Use new python macros
- Fix python3 package file ownership - Fix python3 package file ownership

View File

@ -1 +1 @@
685e2137062c9821b1b74a4814795514 pytest-2.8.7.tar.gz 05165740ea50928e4e971378630163ec pytest-2.9.1.tar.gz