14
0

- Convert to pip-based build and libalternatives

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-restructuredtext_lint?expand=0&rev=15
This commit is contained in:
2025-06-11 13:08:07 +00:00
committed by Git OBS Bridge
parent d39e67ddb5
commit 9b1720f1dd
2 changed files with 18 additions and 14 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jun 11 13:07:42 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build and libalternatives
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 7 15:00:41 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com> Fri Oct 7 15:00:41 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-restructuredtext_lint # spec file for package python-restructuredtext_lint
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2025 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without libalternatives
Name: python-restructuredtext_lint Name: python-restructuredtext_lint
Version: 1.4.0 Version: 1.4.0
Release: 0 Release: 0
@@ -25,12 +25,14 @@ License: Unlicense
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/twolfson/restructuredtext-lint URL: https://github.com/twolfson/restructuredtext-lint
Source: https://files.pythonhosted.org/packages/source/r/restructuredtext_lint/restructuredtext_lint-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/r/restructuredtext_lint/restructuredtext_lint-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: alts
Requires: python-docutils >= 0.11 Requires: python-docutils >= 0.11
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch BuildArch: noarch
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module docutils >= 0.11} BuildRequires: %{python_module docutils >= 0.11}
@@ -49,10 +51,10 @@ in junction with a Sublime Text linter.
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/rst-lint %python_clone -a %{buildroot}%{_bindir}/rst-lint
%python_clone -a %{buildroot}%{_bindir}/restructuredtext-lint %python_clone -a %{buildroot}%{_bindir}/restructuredtext-lint
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
@@ -62,19 +64,16 @@ find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
$python -m unittest discover $python -m unittest discover
} }
%post %pre
%python_install_alternative rst-lint %python_libalternatives_reset_alternative rst-lint
%python_install_alternative restructuredtext-lint %python_libalternatives_reset_alternative restructuredtext-lint
%postun
%python_uninstall_alternative rst-lint
%python_uninstall_alternative restructuredtext-lint
%files %{python_files} %files %{python_files}
%doc CHANGELOG.rst README.rst %doc CHANGELOG.rst README.rst
%license UNLICENSE %license UNLICENSE
%python_alternative %{_bindir}/restructuredtext-lint %python_alternative %{_bindir}/restructuredtext-lint
%python_alternative %{_bindir}/rst-lint %python_alternative %{_bindir}/rst-lint
%{python_sitelib}/* %{python_sitelib}/restructuredtext_lint
%{python_sitelib}/restructuredtext_lint-%{version}*-info
%changelog %changelog