- Use libalternatives on Tumbleweed. Include git and mercurial to properly run tests

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-versioningit?expand=0&rev=2
This commit is contained in:
Tejas Guruswamy 2022-06-03 20:14:58 +00:00 committed by Git OBS Bridge
parent 84b2dd6b51
commit b3ee2a7337
3 changed files with 56 additions and 34 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jun 3 20:14:18 UTC 2022 - Tejas Guruswamy <tejas.guruswamy@opensuse.org>
- Use libalternatives on Tumbleweed. Include git and mercurial to properly run tests
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jun 1 16:57:04 UTC 2022 - Tejas Guruswamy <tejas.guruswamy@opensuse.org> Wed Jun 1 16:57:04 UTC 2022 - Tejas Guruswamy <tejas.guruswamy@opensuse.org>

View File

@ -18,6 +18,12 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
Name: python-versioningit Name: python-versioningit
Version: 1.1.1 Version: 1.1.1
Release: 0 Release: 0
@ -25,19 +31,22 @@ Summary: Versioning It with your Version In Git
License: MIT License: MIT
URL: https://github.com/jwodder/versioningit URL: https://github.com/jwodder/versioningit
Source: https://files.pythonhosted.org/packages/source/v/versioningit/versioningit-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/v/versioningit/versioningit-%{version}.tar.gz
BuildRequires: python3 >= 3.7 BuildRequires: %{python_module pip}
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
BuildRequires: python3 >= 3.7
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module packaging} BuildRequires: %{python_module packaging}
BuildRequires: %{python_module build}
BuildRequires: %{python_module pydantic}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tomli >= 1.2} BuildRequires: %{python_module tomli >= 1.2}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pydantic}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module build}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: git
BuildRequires: mercurial
# /SECTION # /SECTION
BuildRequires: fdupes BuildRequires: fdupes
Requires: python-packaging Requires: python-packaging
@ -45,8 +54,13 @@ Requires: python-setuptools
Requires: python-tomli >= 1.2 Requires: python-tomli >= 1.2
Suggests: python-importlib-metadata >= 3.6 Suggests: python-importlib-metadata >= 3.6
Suggests: python-dataclasses Suggests: python-dataclasses
%if %{with libalternatives}
Requires: alts
BuildRequires: alts
%else
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun):update-alternatives Requires(postun):update-alternatives
%endif
BuildArch: noarch BuildArch: noarch
%python_subpackages %python_subpackages
@ -60,15 +74,18 @@ separate functions used for version extraction & calculation.
%setup -q -n versioningit-%{version} %setup -q -n versioningit-%{version}
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/versioningit
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/versioningit
%check %check
%pytest test %pytest test -k 'not test_editable_mode'
%pre
%python_libalternatives_reset_alternative versioningit
%post %post
%python_install_alternative versioningit %python_install_alternative versioningit

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:77f09ae1cb0d81263796b979da581db8c1d0de44380bcc5af51b7b81d7c4968b oid sha256:69ed77cdacc67e05935eba2fbfa40d365f555a7b08d7f1453576757d3c25ed35
size 662205 size 678420