15
0
Files
python-humanfriendly/python-humanfriendly.spec
Markéta Machová 53e417006b Accepting request 912658 from home:glaubitz:branches:devel:languages:python
- Update to 9.2
  Maintenance release:
  * Merged pull request `#46`_ which fixes several :pypi:`flake8` warnings.
  * Merged pull request `#49`_ which marks Python 3.9 support final.
  * Merged pull request `#51`_ which helps to stabilize the test suite.
  * Merged pull request `#52`_ which updates the :mod:`humanfriendly.sphinx`
    module to include Sphinx extension metadata that has become mandatory in a
    recent Sphinx release. After merging the pull request I added additional
    metadata including the version.
- from version 9.1
  * Added :func:`~humanfriendly.compat.on_macos()` function to detect Apple MacOS
    (I need this in an upcoming :pypi:`coloredlogs` release and don't want to have
    to think about how to detect MacOS again in the future 😇).
- from version 9.0
  The major version number was bumped because the bug fix for
  :func:`~humanfriendly.text.pluralize()` is backwards incompatible
  and (even though this seems like very "cosmetic" functionality)
  version numbers are cheap, so who cares 😉.
  **Bug fixes:**
  * Changed :func:`~humanfriendly.format_number()` to properly support negative
    numbers (as suggested in `issue #40`_).
  * Changed :func:`~humanfriendly.text.pluralize()` to generate "1.5 seconds"
    instead of "1.5 second" (as suggested in `issue #43`_).
  **Enhancements:**
  * Enhanced :func:`~humanfriendly.text.concatenate()` to support ``conjunction``
    and ``serial_comma`` keyword arguments (as suggested in `issue #30`_).
  * Added :func:`~humanfriendly.text.pluralize_raw()` to select singular or
    plural form without prefixing the count to the text that is returned.
- from version 8.2
  * Added a simple case insensitive dictionary implementation, for details refer to

OBS-URL: https://build.opensuse.org/request/show/912658
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-humanfriendly?expand=0&rev=32
2021-08-17 15:28:24 +00:00

113 lines
3.5 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
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%bcond_without python2
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-humanfriendly%{psuffix}
Version: 9.2
Release: 0
Summary: Human friendly input/output for text interfaces using Python
License: MIT
URL: https://github.com/xolox/python-humanfriendly
Source: https://files.pythonhosted.org/packages/source/h/humanfriendly/humanfriendly-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module capturer >= 2.1}
BuildRequires: %{python_module coloredlogs >= 2}
BuildRequires: %{python_module docutils}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest >= 3.0.7}
BuildRequires: %{python_module pytest-cov >= 2.4.0}
BuildRequires: %{pythons}
%if %{with python2}
BuildRequires: python2-monotonic
%endif
%endif
%ifpython2
Requires: python-monotonic
%endif
%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
%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|#!%{_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}
%check
%pytest humanfriendly/tests.py
%endif
%if !%{with test}
%post
%python_install_alternative humanfriendly
%postun
%python_uninstall_alternative humanfriendly
%files %{python_files}
%license LICENSE.txt
%doc README.rst
%python_alternative %{_bindir}/humanfriendly
%{python_sitelib}/humanfriendly
%{python_sitelib}/humanfriendly-%{version}-py*.egg-info
%endif
%changelog