1
0
python-importlib-metadata/python-importlib-metadata.spec
Dirk Mueller 67d3b8146c - update to 3.7.0:
* #131: Added ``packages_distributions`` to conveniently
    resolve a top-level package or module to its distribution(s).
  * #284: Introduces new ``EntryPoints`` object, a tuple of
    ``EntryPoint`` objects but with convenience properties for
    selecting and inspecting the results:
    - ``.select()`` accepts ``group`` or ``name`` keyword
      parameters and returns a new ``EntryPoints`` tuple
      with only those that match the selection.
    - ``.groups`` property presents all of the group names.
    - ``.names`` property presents the names of the entry points.
    - Item access (e.g. ``eps[name]``) retrieves a single
      entry point by name.
    ``entry_points`` now accepts "selection parameters",
    same as ``EntryPoint.select()``.
    ``entry_points()`` now provides a future-compatible
    ``SelectableGroups`` object that supplies the above interface
    but remains a dict for compatibility.
    In the future, ``entry_points()`` will return an
    ``EntryPoints`` object, but provide for backward
    compatibility with a deprecated  ``__getitem__``
    accessor by group and a ``get()`` method.
    If passing selection parameters to ``entry_points``, the
    future behavior is invoked and an ``EntryPoints`` is the
    result.
    Construction of entry points using
    ``dict([EntryPoint, ...])`` is now deprecated and raises
    an appropriate DeprecationWarning and will be removed in
    a future version.
  * #280: ``entry_points`` now only returns entry points for

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-importlib-metadata?expand=0&rev=12
2021-03-02 00:22:37 +00:00

107 lines
3.7 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-importlib-metadata
#
# 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
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-importlib-metadata%{psuffix}
Version: 3.7.0
Release: 0
Summary: Read metadata from Python packages
License: Apache-2.0
URL: http://importlib-metadata.readthedocs.io/
Source: https://files.pythonhosted.org/packages/source/i/importlib_metadata/importlib_metadata-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.6}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module toml}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-zipp >= 0.5
%if %{python_version_nodots} < 38
Requires: python-typing_extensions >= 3.6.4
%endif
Provides: python-importlib_metadata = %{version}
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module importlib_resources >= 1.3}
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module pep517}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pyfakefs}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module testsuite}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module zipp >= 0.5}
BuildRequires: (python3-typing_extensions >= 3.6.4 if python3-base < 3.8)
BuildRequires: (python36-typing_extensions >= 3.6.4 if python36-base)
%endif
%python_subpackages
%description
importlib_metadata is a library which provides an API for accessing an installed
packages metadata (see PEP 566), such as its entry points or its top-level
name. This functionality intends to replace most uses of pkg_resources entry
point API and metadata API. Along with importlib.resources in Python 3.7 and
newer (backported as importlib_resources for older versions of Python), this can
eliminate the need to use the older and less efficient pkg_resources package.
importlib_metadata is a backport of Python 3.8s standard library
importlib.metadata module for Python 2.7, and 3.4 through 3.7. Users of Python
3.8 and beyond are encouraged to use the standard library module. When imported
on Python 3.8 and later, importlib_metadata replaces the DistributionFinder
behavior from the stdlib, but leaves the API in tact. Developers looking for
detailed API descriptions should refer to the Python 3.8 standard library
documentation.
%prep
%setup -q -n importlib_metadata-%{version}
# don't import from sourcedir during testing
sed -i -e 's/norecursedirs.*/& importlib_metadata/' pytest.ini
%build
%python_build
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
%pytest
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/importlib_metadata
%{python_sitelib}/importlib_metadata-%{version}*-info
%endif
%changelog