File python3-setuptools_scm.spec of Package python3-setuptools_scm
#
# spec file for package python3-setuptools_scm
#
# 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/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python3-setuptools_scm%{psuffix}
Version: 3.5.0
Release: 0
Summary: Python setuptools handler for SCM tags
License: MIT
URL: https://github.com/pypa/setuptools_scm
Source: https://files.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz
Patch0: add-rpmfail-pytest-markers.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-packaging
BuildRequires: python3-pip
BuildRequires: python3-setuptools
BuildRequires: python3-wheel
Requires: python3-importlib-metadata
Requires: python3-packaging
Requires: python3-setuptools
Requires: python3-toml
BuildArch: noarch
%if %{with test}
BuildRequires: git-core
BuildRequires: mercurial
# Testing requirements
BuildRequires: python3-pytest
BuildRequires: python3-setuptools_scm = %{version}
BuildRequires: python3-toml
BuildRequires: python3-virtualenv
%endif
%if 0%{?suse_version} || 0%{?fedora_version} >= 24
Recommends: git-core
%endif
%description
The setuptools_scm package handles managing one's Python package versions
in SCM metadata. It also handles file finders for the supperted SCMs.
%prep
%autosetup -p1 -n setuptools_scm-%{version}
%build
%pyproject_wheel
%install
%if !%{with test}
%pyproject_install
%fdupes %{buildroot}%{python3_sitelib}
%endif
%if %{with test}
%check
%pytest
%endif
%if !%{with test}
%files
%license LICENSE
%doc README.rst CHANGELOG.rst
%{python3_sitelib}/setuptools_scm
%{python3_sitelib}/setuptools_scm-%{version}*-info
%endif
%changelog