2015-08-12 15:10:39 +00:00
#
2024-05-06 05:39:31 +00:00
# spec file for package python-setuptools_scm
2015-08-12 15:10:39 +00:00
#
2024-01-06 13:08:37 +00:00
# Copyright (c) 2024 SUSE LLC
2024-05-06 05:39:31 +00:00
# Copyright (c) 2024 Andreas Stieger <Andreas.Stieger@gmx.de>
2015-08-12 15:10:39 +00:00
#
# 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.
2018-09-18 05:52:54 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2015-08-12 15:10:39 +00:00
#
2017-03-02 14:49:06 +00:00
2018-07-31 10:03:39 +00:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
2019-07-18 09:22:29 +00:00
%define psuffix -test
2018-07-31 10:03:39 +00:00
%bcond_without test
%else
2019-07-18 09:22:29 +00:00
%define psuffix %{nil}
2018-04-14 06:46:36 +00:00
%bcond_with test
2018-07-31 10:03:39 +00:00
%endif
2023-04-21 14:04:04 +00:00
%{?sle15_python_module_pythons}
2019-07-18 09:22:29 +00:00
Name : python-setuptools_scm%{psuffix}
2023-12-27 11:42:33 +00:00
Version : 8.0.4
2015-08-12 15:10:39 +00:00
Release : 0
2018-08-08 17:00:48 +00:00
Summary : Python setuptools handler for SCM tags
2015-08-12 15:10:39 +00:00
License : MIT
2024-05-06 05:39:31 +00:00
URL : https://github.com/pypa/setuptools_scm/
2023-12-27 11:42:33 +00:00
Source : https://files.pythonhosted.org/packages/source/s/setuptools-scm/setuptools-scm-%{version} .tar.gz
2024-01-06 13:08:37 +00:00
# PATCH-FEATURE-OPENSUSE setuptools-scm-issue953-nowarn.patch gh#pypa/setuptools_scm#953 -- don't warn if setuptools_scm is present but not directly used
Patch0 : setuptools-scm-issue953-nowarn.patch
2024-05-06 05:39:31 +00:00
# PATCH-FIX-UPSTREAM setuptools-scm-issue1038-git-2-45-0.patch gp#pypa/setuptools_scm#1038 -- fix build with git 2.45.0
Patch1 : setuptools-scm-issue1038-git-2-45-0.patch
2023-12-27 11:42:33 +00:00
BuildRequires : %{python_module base >= 3.8}
2022-11-10 10:45:44 +00:00
BuildRequires : %{python_module pip}
2024-01-06 13:08:37 +00:00
BuildRequires : %{python_module setuptools >= 61}
BuildRequires : %{python_module tomli if %python-base < 3.11}
2022-11-10 10:45:44 +00:00
BuildRequires : %{python_module wheel}
2018-08-11 19:54:22 +00:00
BuildRequires : fdupes
2017-03-02 14:49:06 +00:00
BuildRequires : python-rpm-macros
2021-10-03 20:39:30 +00:00
Requires : python-packaging >= 20.0
2018-04-14 06:46:36 +00:00
Requires : python-setuptools
2022-11-10 10:45:44 +00:00
Requires : python-typing-extensions
2024-05-06 05:39:31 +00:00
BuildArch : noarch
2023-05-11 06:54:39 +00:00
%if 0%{?python_version_nodots} < 311
Requires : python-tomli >= 1
%endif
2017-06-26 14:10:23 +00:00
%if %{with test}
2015-08-12 15:10:39 +00:00
# Testing requirements
2024-01-06 13:08:37 +00:00
BuildRequires : %{python_module build}
2019-11-01 08:57:57 +00:00
BuildRequires : %{python_module pytest}
2018-08-07 07:29:17 +00:00
BuildRequires : %{python_module setuptools_scm = %{version} }
2019-04-02 15:43:53 +00:00
BuildRequires : git-core
2020-01-31 10:34:57 +00:00
BuildRequires : mercurial
2017-06-26 14:10:23 +00:00
%endif
2018-07-31 09:18:18 +00:00
%if 0%{?suse_version} || 0%{?fedora_version} >= 24
2019-04-02 15:43:53 +00:00
Recommends: git-core
2018-02-27 21:31:52 +00:00
%endif
2017-03-02 14:38:21 +00:00
%python_subpackages
2015-08-12 15:10:39 +00:00
%description
2018-08-08 17:00:48 +00:00
The setuptools_scm package handles managing one's Python package versions
in SCM metadata. It also handles file finders for the supperted SCMs.
2015-08-12 15:10:39 +00:00
%prep
2023-12-27 11:42:33 +00:00
%autosetup -p1 -n setuptools-scm-%{version}
2015-08-12 15:10:39 +00:00
%build
2022-11-10 10:45:44 +00:00
%pyproject_wheel
2015-08-12 15:10:39 +00:00
%install
2018-08-07 07:20:00 +00:00
%if !%{with test}
2022-11-10 10:45:44 +00:00
%pyproject_install
2018-07-31 09:18:18 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2018-08-07 07:20:00 +00:00
%endif
2015-08-12 15:10:39 +00:00
2017-06-26 14:10:23 +00:00
%if %{with test}
2015-08-12 15:10:39 +00:00
%check
2021-10-03 20:39:30 +00:00
# pip download needs network
2022-11-10 10:45:44 +00:00
donttest=" t e s t _ p i p _ d o w n l o a d "
2024-01-06 13:08:37 +00:00
%pytest -rsEf -k " n o t ( $ d o n t t e s t ) "
2017-06-26 14:10:23 +00:00
%endif
2015-08-12 15:10:39 +00:00
2019-04-03 08:02:15 +00:00
%if !%{with test}
2018-04-14 06:46:36 +00:00
%files %{python_files}
%license LICENSE
2023-12-27 11:42:33 +00:00
%doc README.md CHANGELOG.md
2021-10-03 20:39:30 +00:00
%{python_sitelib} /setuptools_scm
%{python_sitelib} /setuptools_scm-%{version} *-info
2018-08-07 07:20:00 +00:00
%endif
2015-08-12 15:10:39 +00:00
%changelog