Accepting request 1066937 from devel:languages:python

- Switch to _multibuild to avoid a build cycle with pytest.

OBS-URL: https://build.opensuse.org/request/show/1066937
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-hatch_vcs?expand=0&rev=5
This commit is contained in:
Dominique Leuenberger 2023-02-22 14:21:03 +00:00 committed by Git OBS Bridge
commit cf83edfae9
3 changed files with 26 additions and 5 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Feb 21 08:48:31 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Switch to _multibuild to avoid a build cycle with pytest.
-------------------------------------------------------------------
Sat Dec 10 17:00:57 UTC 2022 - Johannes Kastl <kastl@b1-systems.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-hatch_vcs
# spec file
#
# Copyright (c) 2022 SUSE LLC
# 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
@ -16,9 +16,15 @@
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-hatch_vcs
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-hatch_vcs%{psuffix}
Version: 0.3.0
Release: 0
Summary: Hatch plugin for versioning with your preferred VCS
@ -36,11 +42,13 @@ BuildArch: noarch
BuildRequires: %{python_module hatchling >= 0.21.0}
BuildRequires: %{python_module pip}
# /SECTION
%if %{with test}
# SECTION test
BuildRequires: %{python_module setuptools_scm >= 6.4.0}
BuildRequires: %{python_module pytest}
BuildRequires: git
# /SECTION
%endif
%python_subpackages
%description
@ -57,12 +65,17 @@ This provides a plugin for Hatch that uses your preferred version control system
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%if %{with test}
%pytest tests
rm -rf %{buildroot}
%endif
%if %{without test}
%files %{python_files}
%license LICENSE.txt
%doc README.md
%{python_sitelib}/hatch_vcs
%{python_sitelib}/hatch_vcs-%{version}*-info
%endif
%changelog