2023-09-26 13:00:37 +00:00
|
|
|
%bcond tests 1
|
2017-08-15 16:29:32 +00:00
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
Name: python-setuptools_scm
|
2023-09-26 10:15:13 +00:00
|
|
|
Version: 8.0.3
|
2023-09-26 13:01:22 +00:00
|
|
|
Release: %autorelease
|
2019-08-15 15:10:36 +00:00
|
|
|
Summary: Blessed package to manage your versions by SCM tags
|
2015-10-21 15:13:26 +00:00
|
|
|
|
2023-05-24 08:35:36 +00:00
|
|
|
# SPDX
|
2015-10-21 15:13:26 +00:00
|
|
|
License: MIT
|
2023-09-26 12:42:56 +00:00
|
|
|
URL: https://github.com/pypa/setuptools_scm/
|
2023-09-26 12:41:36 +00:00
|
|
|
Source: %{pypi_source setuptools-scm}
|
2015-10-21 15:13:26 +00:00
|
|
|
|
|
|
|
BuildArch: noarch
|
2017-08-15 16:29:32 +00:00
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-devel
|
2017-08-15 16:29:32 +00:00
|
|
|
%if %{with tests}
|
2015-10-21 15:13:26 +00:00
|
|
|
BuildRequires: git-core
|
2023-05-24 08:24:30 +00:00
|
|
|
# Don't pull mercurial into RHEL just to test this work with it
|
2023-06-29 17:07:27 +00:00
|
|
|
%if %{undefined rhel}
|
2015-10-21 15:13:26 +00:00
|
|
|
BuildRequires: mercurial
|
2017-08-15 16:29:32 +00:00
|
|
|
%endif
|
2023-05-24 08:35:06 +00:00
|
|
|
# Manually listed test dependencies from tox.ini, to avoid pulling tox into RHEL
|
2023-10-02 16:47:27 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}dist(pytest)
|
|
|
|
BuildRequires: python%{python3_pkgversion}dist(setuptools) >= 45
|
2023-09-26 13:00:06 +00:00
|
|
|
# virtualenv omitted, see https://github.com/pypa/setuptools_scm/pull/940
|
2023-09-26 13:13:08 +00:00
|
|
|
# rich omitted, pulled in only with the [rich] extra
|
2023-05-24 08:24:30 +00:00
|
|
|
%endif
|
2015-10-21 15:13:26 +00:00
|
|
|
|
|
|
|
%description
|
2021-01-29 18:21:24 +00:00
|
|
|
Setuptools_scm handles managing your Python package versions in SCM metadata.
|
2019-08-15 15:10:36 +00:00
|
|
|
It also handles file finders for the supported SCMs.
|
2015-10-21 15:13:26 +00:00
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
|
|
|
|
%package -n python%{python3_pkgversion}-setuptools_scm
|
2018-01-20 08:58:24 +00:00
|
|
|
Summary: %{summary}
|
2015-10-21 15:13:26 +00:00
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
%description -n python%{python3_pkgversion}-setuptools_scm
|
|
|
|
Setuptools_scm handles managing your Python package versions in SCM metadata.
|
2019-08-15 15:10:36 +00:00
|
|
|
It also handles file finders for the supported SCMs.
|
2015-10-21 15:13:26 +00:00
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
|
2023-09-26 13:13:08 +00:00
|
|
|
# We don't package the [rich] extra on RHELs, to avoid pulling rich into the buildroot
|
|
|
|
%pyproject_extras_subpkg -n python%{python3_pkgversion}-setuptools_scm toml%{!?rhel:,rich}
|
2021-01-29 18:21:24 +00:00
|
|
|
|
2020-07-10 15:14:23 +00:00
|
|
|
|
2015-10-21 15:13:26 +00:00
|
|
|
%prep
|
2023-09-21 09:48:29 +00:00
|
|
|
%autosetup -p1 -n setuptools-scm-%{version}
|
2023-09-26 13:13:08 +00:00
|
|
|
# Upstream bogusly declares rich as a build-system dependency,
|
|
|
|
# but the build works without it.
|
|
|
|
# We remove it here to simplify the bootstrap loop
|
|
|
|
# and to avoid the dependency in RHEL builds.
|
|
|
|
# Upstream issue: https://github.com/pypa/setuptools_scm/issues/941
|
|
|
|
# Upstream PR: https://github.com/pypa/setuptools_scm/pull/942
|
|
|
|
# The PR does not apply cleanly to 8.0.3, so we sed it out instead.
|
|
|
|
# The sed removes the first line with "rich" only:
|
|
|
|
sed -i '0,/"rich"/{/"rich"/d}' pyproject.toml
|
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
2023-09-26 13:13:08 +00:00
|
|
|
%pyproject_buildrequires %{?with_tests:%{!?rhel:-x rich}}
|
2021-01-29 18:21:24 +00:00
|
|
|
|
2015-10-21 15:13:26 +00:00
|
|
|
|
|
|
|
%build
|
2021-01-29 18:21:24 +00:00
|
|
|
%pyproject_wheel
|
|
|
|
|
2015-10-21 15:13:26 +00:00
|
|
|
|
|
|
|
%install
|
2021-01-29 18:21:24 +00:00
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files setuptools_scm
|
|
|
|
|
2015-10-21 15:13:26 +00:00
|
|
|
|
2017-08-15 16:29:32 +00:00
|
|
|
%if %{with tests}
|
2015-10-21 15:13:26 +00:00
|
|
|
%check
|
2023-09-26 13:00:06 +00:00
|
|
|
# Skipped test tries to download from the internet
|
|
|
|
%pytest -v -k 'not test_pip_download'
|
2019-11-16 22:37:35 +00:00
|
|
|
%endif
|
2015-10-21 15:13:26 +00:00
|
|
|
|
2021-01-29 18:21:24 +00:00
|
|
|
|
|
|
|
%files -n python%{python3_pkgversion}-setuptools_scm -f %{pyproject_files}
|
2023-09-21 09:48:29 +00:00
|
|
|
%doc README.md
|
2021-01-29 18:21:24 +00:00
|
|
|
|
2017-04-10 15:35:04 +00:00
|
|
|
|
2015-10-21 15:13:26 +00:00
|
|
|
%changelog
|
2023-09-26 13:01:22 +00:00
|
|
|
%autochangelog
|