From 7b4635479583b279fd06e7c526770ab0f4360eb9b9f3daede06a15ef187b661d Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Mon, 12 May 2025 10:44:26 +0000 Subject: [PATCH] - Use %pyproject macros - Skip failing test TestCli.test_no_arguments - Use libalternatives instead of update-alternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-anymarkup?expand=0&rev=2 --- python-anymarkup.changes | 7 +++++++ python-anymarkup.spec | 43 +++++++++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/python-anymarkup.changes b/python-anymarkup.changes index 9feb64c..d6bc6e1 100644 --- a/python-anymarkup.changes +++ b/python-anymarkup.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 12 10:33:47 UTC 2025 - Daniel Garcia + +- Use %pyproject macros +- Skip failing test TestCli.test_no_arguments +- Use libalternatives instead of update-alternatives + ------------------------------------------------------------------- Wed Jan 20 16:08:55 UTC 2021 - John Vandenberg diff --git a/python-anymarkup.spec b/python-anymarkup.spec index a812a62..bec0eb8 100644 --- a/python-anymarkup.spec +++ b/python-anymarkup.spec @@ -1,7 +1,7 @@ # # spec file for package python-anymarkup # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2025 SUSE LLC # Copyright (c) 2020 SUSE Software Solutions Germany GmbH. # # All modifications and additions to the file contributed by third parties @@ -17,7 +17,12 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + Name: python-anymarkup Version: 0.8.1 Release: 0 @@ -26,7 +31,9 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/bkabrda/anymarkup Source0: https://github.com/bkabrda/anymarkup/archive/v%{version}/anymarkup-%{version}.tar.gz +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Suggests: python-click @@ -41,6 +48,22 @@ BuildRequires: %{python_module pytest} BuildRequires: %{python_module toml} BuildRequires: %{python_module xmltodict} # /SECTION +Requires: python-anymarkup-core +Requires: python-PyYAML +Requires: python-click +Requires: python-configobj +Requires: python-json5 +Requires: python-toml +Requires: python-xmltodict + +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif + %python_subpackages %description @@ -48,18 +71,23 @@ Parse or serialize any markup. Currently supports ini, json, json5, toml, xml and yaml. %prep -%setup -q -n anymarkup-%{version} +%autosetup -p1 -n anymarkup-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/anymarkup %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest +donttest="test_no_arguments" +%pytest -k "not ($donttest)" + +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative anymarkup %post %python_install_alternative anymarkup @@ -71,6 +99,7 @@ xml and yaml. %doc README.rst %license LICENSE %python_alternative %{_bindir}/anymarkup -%{python_sitelib}/* +%{python_sitelib}/anymarkup +%{python_sitelib}/anymarkup*-info %changelog