#
# spec file for package python-jaraco.packaging
#
# Copyright (c) 2023 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/
#
%define skip_python2 1
%define skip_python36 1
%define skip_python38 1
%define skip_python39 1
%define skip_python311 1

%{?sle15_python_module_pythons}
Name:           python-jaraco.packaging
Version:        9.2.0
Release:        1.2
Summary:        Supplement packaging Python releases
License:        MIT
URL:            https://github.com/jaraco/jaraco.packaging
Source:         https://files.pythonhosted.org/packages/source/j/jaraco.packaging/jaraco.packaging-%{version}.tar.gz
Source10:       https://files.pythonhosted.org/packages/py3/s/sampleproject/sampleproject-3.0.0-py3-none-any.whl
BuildRequires:  %{python_module base >= 3.7}
BuildRequires:  %{python_module build}
BuildRequires:  %{python_module importlib-metadata if %python-version < 3.8}
BuildRequires:  %{python_module jaraco.context}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools >= 56}
BuildRequires:  %{python_module setuptools_scm >= 3.4.1}
BuildRequires:  %{python_module virtualenv >= 20}
BuildRequires:  %{python_module wheel}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
# SECTION test
BuildRequires:  %{python_module pytest}
BuildRequires:  ca-certificates
# /SECTION
Requires:       python-build
Requires:       python-jaraco.context
# From build[virtualenv]
Requires:       python-virtualenv >= 20
%if 0%{?python_version_nodots} < 38
Requires:       python-importlib-metadata
%endif
BuildArch:      noarch
%python_subpackages

%description
Tools to supplement packaging Python releases.

%prep
%autosetup -p1 -n jaraco.packaging-%{version}
rm -rf jaraco.packaging.egg-info

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
export PIP_FIND_LINKS=$(dirname %{SOURCE10})
%pytest

%files %{python_files}
%license LICENSE
%doc docs/*.rst CHANGES.rst README.rst
%{python_sitelib}/jaraco.packaging-%{version}*-info
%dir %{python_sitelib}/jaraco
%{python_sitelib}/jaraco/packaging/

%changelog
* Fri May 12 2023 Ben Greiner <code@bnavigator.de>
- Update to 9.2.0
  * #7, #10, #11: Added environment variable to bypass building
    metadata for offline builds.
- Add virtualenv dependency
- Reenable tests
* Fri Apr 21 2023 Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
* Thu Apr 13 2023 Matej Cepl <mcepl@suse.com>
- Make calling of %%{sle15modernpython} optional.
* Wed Jan  4 2023 Dirk Müller <dmueller@suse.com>
- update to 9.1.2:
  * #6: Added minimal test to ``sphinx.packaging``.
* Fri Oct 28 2022 Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to v9.1.1
  * Change requirement to build[virtualenv] as workaround for pypa/build#266.
- Update to v9.1.0
  * Prefer build to pep517 for loading package metadata.
* Mon Aug 29 2022 Ben Greiner <code@bnavigator.de>
- Remove stray python3.inv
* Mon Aug 29 2022 Ben Greiner <code@bnavigator.de>
- Update to v9.0.0
  * Use pep517.meta to load package metadata. Adds support
    for packages without setup.py.
  * Removed info module (and setuptools show command).
  * Removed depends module. Use other packaging tools instead.
- v8.2.1: Rely on PEP 420 for namespace package.
- v8.2.0: Inject rst_epilog to include ``|project|`` substitution.
- Remove jaraco.base: PEP420 namespace packages do not use that
  kind of scheme anymore.
* Mon Nov  8 2021 Dirk Müller <dmueller@suse.com>
- add missing six dependency declaration
* Mon Mar  9 2020 Marketa Calabkova <mcalabkova@suse.com>
- Update to 8.1.0
  * In sphinx when loading metadata, trap a ValueError to include the offending value.
  * Require Python 3.6 or later.
  * Removed 'cheese' package as it was built for a use-case that is no longer needed.
  * Sphinx plugin now declares support for parallel reads (optimistically).
* Mon Oct 14 2019 Matej Cepl <mcepl@suse.com>
- Run SPEC file through spec-cleaner -i.
* Tue Feb 26 2019 John Vandenberg <jayvdb@gmail.com>
- Add LICENSE
- Remove bcond_with test, and skip two failing tests
- Compile manually due to switch to pkgutil namespace technique
- Add docs/*.rst to %%doc
- Update to v6.1
  * Sphinx plugin now exposes ``package_url`` in HTML templates.
- from 6.0
  * Switch to pkgutil namespace technique for the ``jaraco`` namespace.
- from 5.2
  * Show command now also honors direct attributes on a Distribution instance.
- from 5.1.1
  * In Sphinx module, use universal newlines to avoid broken results on Windows.
- from 5.1
  * Added ``jaraco.packaging.make-tree`` utility for taking output from
    pipdeptree and making a tree of it.
- from 5.0
  * Drop support for Python 2.6.
  * Re-aligned to use pkg_resources-managed technique for
    the jaraco namespace, all package of which must elect one
    technique or another.
* Mon Nov 13 2017 toddrme2178@gmail.com
- Add namespace package that other jaraco packages can use.
- Properly handle namespace package structure.
  This guarantees the module is importable.
* Wed Jul  5 2017 aloisio@gmx.com
- Initial package (4.1)