Accepting request 1301252 from devel:languages:python

- Convert to libalternatives on SLE-16-based and newer systems

OBS-URL: https://build.opensuse.org/request/show/1301252
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pyright?expand=0&rev=2
This commit is contained in:
2025-08-25 18:36:25 +00:00
committed by Git OBS Bridge
2 changed files with 26 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Aug 25 11:34:26 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems
-------------------------------------------------------------------
Sat Aug 17 00:41:42 UTC 2024 - Guang Yee <gyee@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pyright
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,11 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-pyright
Version: 1.1.376
@@ -24,20 +29,25 @@ Summary: Command line wrapper for pyright
License: MIT
URL: https://github.com/RobertCraigie/pyright-python
Source: https://github.com/RobertCraigie/pyright-python/archive/refs/tags/v%{version}.tar.gz#/pyright-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-subprocess}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-nodeenv >= 1.6.0
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module nodeenv >= 1.6.0}
# /SECTION
BuildRequires: fdupes
Requires: python-nodeenv >= 1.6.0
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%endif
%python_subpackages
%description
@@ -62,9 +72,13 @@ Command line wrapper for pyright
%python_clone -a %{buildroot}%{_bindir}/pyright-python
%python_clone -a %{buildroot}%{_bindir}/pyright-langserver
%python_clone -a %{buildroot}%{_bindir}/pyright-python-langserver
%python_group_libalternatives pyright pyright-python pyright-langserver pyright-python-langserver
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_expand %fdupes %{buildroot}%{_bindir}
%pre
%python_libalternatives_reset_alternative pyright
%post
%python_install_alternative pyright pyright-python pyright-langserver pyright-python-langserver