forked from pool/python-humanfriendly
- Update to 2.3.1:
* updated tests for upstream wycheproof changes * many other tiny test tweaks OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-humanfriendly?expand=0&rev=11
This commit is contained in:
committed by
Git OBS Bridge
parent
6f0556a8de
commit
ab2879b4b7
@@ -16,32 +16,41 @@
|
||||
#
|
||||
|
||||
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "test"
|
||||
%bcond_without test
|
||||
%else
|
||||
%bcond_with test
|
||||
%endif
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
# Dependency loop with colorlogs
|
||||
%bcond_with test
|
||||
%if %{with test}
|
||||
Name: python-humanfriendly-%{flavor}
|
||||
%else
|
||||
Name: python-humanfriendly
|
||||
Version: 4.8
|
||||
%endif
|
||||
Version: 4.16.1
|
||||
Release: 0
|
||||
Summary: Human friendly input/output for text interfaces using Python
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
Url: https://github.com/xolox/humanfriendly
|
||||
URL: https://github.com/xolox/python-humanfriendly
|
||||
Source: https://files.pythonhosted.org/packages/source/h/humanfriendly/humanfriendly-%{version}.tar.gz
|
||||
BuildRequires: %{python_module devel}
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module capturer >= 2.1}
|
||||
BuildRequires: %{python_module coloredlogs >= 2}
|
||||
BuildRequires: %{python_module pytest >= 3.0.7}
|
||||
BuildRequires: %{python_module pytest-cov >= 2.4.0}
|
||||
BuildRequires: python2-monotonic
|
||||
%endif
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-monotonic
|
||||
BuildRequires: python-rpm-macros
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module coloredlogs >= 2}
|
||||
%endif
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
BuildArch: noarch
|
||||
%ifpython2
|
||||
Requires: python-monotonic
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
@@ -65,32 +74,37 @@ text interfaces more user friendly.
|
||||
%python_build
|
||||
|
||||
%install
|
||||
%if !%{with test}
|
||||
%python_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/humanfriendly
|
||||
%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/humanfriendly/tests.py
|
||||
sed -i "s|#!/usr/bin/env python|#!%__$python|" %{buildroot}%{$python_sitelib}/humanfriendly/tests.py
|
||||
sed -i "s|#!%{_bindir}/env python|#!%__$python|" %{buildroot}%{$python_sitelib}/humanfriendly/tests.py
|
||||
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/humanfriendly/
|
||||
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/humanfriendly/
|
||||
%fdupes %{buildroot}%{$python_sitelib}
|
||||
}
|
||||
%endif
|
||||
|
||||
%if !%{with test}
|
||||
%post
|
||||
%python_install_alternative humanfriendly
|
||||
|
||||
%postun
|
||||
%python_uninstall_alternative humanfriendly
|
||||
%endif
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
%python_exec setup.py test
|
||||
popd
|
||||
%endif
|
||||
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE.txt README.rst
|
||||
%license LICENSE.txt
|
||||
%doc README.rst
|
||||
%if !%{with test}
|
||||
%python_alternative %{_bindir}/humanfriendly
|
||||
%{python_sitelib}/humanfriendly
|
||||
%{python_sitelib}/humanfriendly-%{version}-py*.egg-info
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user