Run tests with pytest, clean cruft

This commit is contained in:
Miro Hrončok 2018-08-28 22:54:36 +02:00
parent 5a83e5086b
commit 2f0e38d68d

View File

@ -1,11 +1,4 @@
%if 0%{?rhel} && 0%{?rhel} <= 7 %bcond_without tests
%bcond_with python3
%else
%bcond_without python3
%endif
# Disable tests since tox.ini is not found properly. I'll try to enable them back ASAP
%bcond_with tests
%global pypi_name wcwidth %global pypi_name wcwidth
@ -16,7 +9,7 @@ Summary: Measures number of Terminal column cells of wide-character codes
License: MIT License: MIT
URL: https://github.com/jquast/wcwidth URL: https://github.com/jquast/wcwidth
Source0: https://pypi.io/packages/source/w/%{pypi_name}/%{pypi_name}-%{version}.tar.gz Source0: %pypi_source
BuildArch: noarch BuildArch: noarch
%description %description
@ -25,73 +18,61 @@ that expect to interpreted by a terminal emulator and wish to determine the
printable width of a string on a Terminal. printable width of a string on a Terminal.
%package -n python2-%{pypi_name} %package -n python2-%{pypi_name}
Summary: %{summary}
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python2-setuptools BuildRequires: python2-setuptools
%if %{with tests} %if %{with tests}
BuildRequires: python2-tox BuildRequires: python2-pytest
%endif # with tests %endif
Summary: Measures number of Terminal column cells of wide-character codes
%{?python_provide:%python_provide python2-%{pypi_name}} %{?python_provide:%python_provide python2-%{pypi_name}}
%{?el6:Provides: python-%{pypi_name}}
%description -n python2-%{pypi_name} %description -n python2-%{pypi_name}
This API is mainly for Terminal Emulator implementors, or those writing programs This API is mainly for Terminal Emulator implementors, or those writing programs
that expect to interpreted by a terminal emulator and wish to determine the that expect to interpreted by a terminal emulator and wish to determine the
printable width of a string on a Terminal. printable width of a string on a Terminal.
%if %{with python3}
%package -n python3-%{pypi_name} %package -n python3-%{pypi_name}
Summary: Measures number of Terminal column cells of wide-character codes Summary: %{summary}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%if %{with tests} %if %{with tests}
BuildRequires: python3-tox BuildRequires: python3-pytest
%endif # with tests %endif
%{?python_provide:%python_provide python3-%{pypi_name}} %{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name} %description -n python3-%{pypi_name}
This API is mainly for Terminal Emulator implementors, or those writing programs This API is mainly for Terminal Emulator implementors, or those writing programs
that expect to interpreted by a terminal emulator and wish to determine the that expect to interpreted by a terminal emulator and wish to determine the
printable width of a string on a Terminal. printable width of a string on a Terminal.
%endif # with python3
%prep %prep
%setup -q -n %{pypi_name}-%{version} %setup -q -n %{pypi_name}-%{version}
%build %build
%py2_build %py2_build
%if %{with python3}
%py3_build %py3_build
%endif # with python3
%install %install
%py2_install %py2_install
%if %{with python3}
%py3_install %py3_install
%endif # with python3
%if %{with tests} %if %{with tests}
%check %check
%{__python2} setup.py test %{__python2} -m pytest -v
%if %{with python3} %{__python3} -m pytest -v
%{__python3} setup.py test
%endif # with python3
%endif # with tests %endif # with tests
%files -n python2-%{pypi_name} %files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc}
%doc README.rst %doc README.rst
%license LICENSE.txt %license LICENSE.txt
%{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if %{with python3}
%files -n python3-%{pypi_name} %files -n python3-%{pypi_name}
%doc README.rst %doc README.rst
%license LICENSE.txt %license LICENSE.txt
%{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with python3
%changelog %changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-8 * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-8