- 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,36 +18,50 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-versioningit %if 0%{?suse_version} > 1500
Version: 1.1.1 %bcond_without libalternatives
Release: 0 %else
Summary: Versioning It with your Version In Git %bcond_with libalternatives
License: MIT %endif
URL: https://github.com/jwodder/versioningit
Source: https://files.pythonhosted.org/packages/source/v/versioningit/versioningit-%{version}.tar.gz Name: python-versioningit
BuildRequires: python3 >= 3.7 Version: 1.1.1
BuildRequires: python-rpm-macros Release: 0
BuildRequires: %{python_module setuptools} Summary: Versioning It with your Version In Git
License: MIT
URL: https://github.com/jwodder/versioningit
Source: https://files.pythonhosted.org/packages/source/v/versioningit/versioningit-%{version}.tar.gz
BuildRequires: %{python_module pip}
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 setuptools} BuildRequires: %{python_module build}
BuildRequires: %{python_module tomli >= 1.2} BuildRequires: %{python_module pydantic}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pydantic} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module build} BuildRequires: %{python_module tomli >= 1.2}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: git
BuildRequires: mercurial
# /SECTION # /SECTION
BuildRequires: fdupes BuildRequires: fdupes
Requires: python-packaging Requires: python-packaging
Requires: python-setuptools 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
Requires(post): update-alternatives %if %{with libalternatives}
Requires(postun): update-alternatives Requires: alts
BuildArch: noarch BuildRequires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
BuildArch: noarch
%python_subpackages %python_subpackages
%description %description
@ -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