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-10-02 19:20:44 +00:00
|
|
|
Version: 8.0.4
|
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-10-02 19:20:44 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}dist(wheel)
|
|
|
|
# build is used only for one test, we don't need it in RHEL just for that
|
|
|
|
%if %{undefined rhel}
|
|
|
|
BuildRequires: python%{python3_pkgversion}dist(build)
|
|
|
|
%endif
|
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-10-02 19:20:44 +00:00
|
|
|
%if %{defined rhel}
|
|
|
|
# Don't blow up all of the tests by failing to report the installed version of build
|
|
|
|
sed -i '0,/VERSION_PKGS/{s/, "build"//}' testing/conftest.py
|
|
|
|
%endif
|
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-10-02 19:20:44 +00:00
|
|
|
# test_pip_download tries to download from the internet
|
|
|
|
# test_pyproject_missing_setup_hook_works requires build
|
|
|
|
%pytest -v -k 'not test_pip_download%{?rhel: and not test_pyproject_missing_setup_hook_works}'
|
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
|