15
0
Files
python-humanfriendly/python-humanfriendly.spec
Robert Schweikert 7ed38a2a38 Accepting request 574412 from home:glaubitz:branches:devel:languages:python
- Update to version 4.8
  * Add coerce_pattern() function
  * Improve code consistency
- From version 4.7
  * Support background colors and 256 color mode
  * Tests for output(), message() and warning()
- From version 4.6
  * Support for bright terminal colors
- From version 4.5
  * Extend byte ranges, add RAM output to command line
- From version 4.4.2
  * Reduce clock source sensitivity* (MacOS on Travis CI)
  * Fix `Double requirement given' error
  * Try to fix Python 2.6 tests on Travis CI
  * Change Sphinx documentation theme
  * Bump copyright
  * Try to enable MacOS builds on Travis CI
  * Fix ImportError exception on Windows
- From version 4.4.1
  * Include docs to sdist
  * PEP-8 fail
  * Change cli test from 1.05 mm to 1.05 km
  * Another correction to test_cli
  * Corrected CLI format_length test
  * Aim for more CLI coverage
  * Add CLI tests for format-byte
  * Added size test cases
  * Size 1z is now valid
- From version 4.4
  * Add touch() to __all__

OBS-URL: https://build.opensuse.org/request/show/574412
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-humanfriendly?expand=0&rev=7
2018-02-08 22:36:25 +00:00

97 lines
3.2 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#
# spec file for package python-humanfriendly
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Dependency loop with colorlogs
%bcond_with test
Name: python-humanfriendly
Version: 4.8
Release: 0
Summary: Human friendly input/output for text interfaces using Python
License: MIT
Group: Development/Languages/Python
Url: https://github.com/xolox/humanfriendly
Source: https://files.pythonhosted.org/packages/source/h/humanfriendly/humanfriendly-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-monotonic
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module coloredlogs >= 2}
%endif
%ifpython2
Requires: python-monotonic
%endif
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
The functions and classes in the humanfriendly package can be used to make
text interfaces more user friendly.
Some example features:
* Parsing and formatting numbers, file sizes, pathnames and timespans in
simple, human friendly formats.
* Easy to use timers for long running operations, with human friendly
formatting of the resulting timespans.
* Prompting the user to select a choice from a list of options by typing
the options number or a unique substring of the option.
* Terminal interaction including text styling (ANSI escape sequences), user
friendly rendering of usage messages and querying the terminal for its size.
%prep
%setup -q -n humanfriendly-%{version}
%build
%python_build
%install
%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
$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}
}
%post
%python_install_alternative humanfriendly
%postun
%python_uninstall_alternative humanfriendly
%if %{with test}
%check
%python_exec setup.py test
popd
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%python_alternative %{_bindir}/humanfriendly
%{python_sitelib}/humanfriendly
%{python_sitelib}/humanfriendly-%{version}-py*.egg-info
%changelog