python-setuptools_scm/python-setuptools_scm.spec

85 lines
2.3 KiB
RPMSpec
Raw Normal View History

%bcond tests 1
2017-08-15 16:29:32 +00:00
Name: python-setuptools_scm
Version: 8.0.4
Release: %autorelease
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
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
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
# Don't pull mercurial into RHEL just to test this work with it
%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
BuildRequires: python%{python3_pkgversion}dist(pytest)
BuildRequires: python%{python3_pkgversion}dist(setuptools) >= 45
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
# rich omitted, pulled in only with the [rich] extra
%endif
2015-10-21 15:13:26 +00:00
%description
Setuptools_scm handles managing your Python package versions in SCM metadata.
It also handles file finders for the supported SCMs.
2015-10-21 15:13:26 +00:00
%package -n python%{python3_pkgversion}-setuptools_scm
Summary: %{summary}
2015-10-21 15:13:26 +00:00
%description -n python%{python3_pkgversion}-setuptools_scm
Setuptools_scm handles managing your Python package versions in SCM metadata.
It also handles file finders for the supported SCMs.
2015-10-21 15:13:26 +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}
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}
%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
%generate_buildrequires
%pyproject_buildrequires %{?with_tests:%{!?rhel:-x rich}}
2015-10-21 15:13:26 +00:00
%build
%pyproject_wheel
2015-10-21 15:13:26 +00:00
%install
%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
# 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
%files -n python%{python3_pkgversion}-setuptools_scm -f %{pyproject_files}
2023-09-21 09:48:29 +00:00
%doc README.md
2017-04-10 15:35:04 +00:00
2015-10-21 15:13:26 +00:00
%changelog
%autochangelog