From c4cf2e808aa719907ca33123a3ae2268b97fdfcac68830ffda6eae0946469b5e Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Thu, 4 Apr 2024 20:56:44 +0000 Subject: [PATCH] Accepting request 1164959 from home:glaubitz:branches:Cloud:Tools - Switch package to modern Python Stack on SLE-15 + Use Python 3.11 on SLE-15 by default + Use primary Python version on Tumbleweed - Switch build system from setuptools to pyproject.toml + Add python-pip and python-wheel to BuildRequires + Replace %python_build with %pyproject_wheel + Replace %python_install with %pyproject_install + Update name for dist directory in %files section OBS-URL: https://build.opensuse.org/request/show/1164959 OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/azure-cli-nspkg?expand=0&rev=15 --- azure-cli-nspkg.changes | 12 ++++++++++++ azure-cli-nspkg.spec | 27 ++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/azure-cli-nspkg.changes b/azure-cli-nspkg.changes index 8e678d6..bbee6a5 100644 --- a/azure-cli-nspkg.changes +++ b/azure-cli-nspkg.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Apr 4 13:16:37 UTC 2024 - John Paul Adrian Glaubitz + +- Switch package to modern Python Stack on SLE-15 + + Use Python 3.11 on SLE-15 by default + + Use primary Python version on Tumbleweed +- Switch build system from setuptools to pyproject.toml + + Add python-pip and python-wheel to BuildRequires + + Replace %python_build with %pyproject_wheel + + Replace %python_install with %pyproject_install + + Update name for dist directory in %files section + ------------------------------------------------------------------- Thu Jul 14 12:44:50 UTC 2022 - John Paul Adrian Glaubitz diff --git a/azure-cli-nspkg.spec b/azure-cli-nspkg.spec index 26546d1..a51c1b0 100644 --- a/azure-cli-nspkg.spec +++ b/azure-cli-nspkg.spec @@ -1,7 +1,7 @@ # # spec file for package azure-cli-nspkg # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,13 @@ # +%if 0%{?suse_version} >= 1600 +%define pythons %{primary_python} +%else +%define pythons python311 +%endif +%global _sitelibdir %{%{pythons}_sitelib} + Name: azure-cli-nspkg Version: 3.0.4 Release: 0 @@ -25,11 +32,13 @@ Group: System/Management URL: https://github.com/Azure/azure-cli Source: https://files.pythonhosted.org/packages/source/a/azure-cli-nspkg/azure-cli-nspkg-%{version}.tar.gz Source1: LICENSE.txt +BuildRequires: %{pythons}-azure-nspkg >= 3.0.0 +BuildRequires: %{pythons}-pip +BuildRequires: %{pythons}-setuptools +BuildRequires: %{pythons}-wheel BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: python3-azure-nspkg >= 3.0.0 -BuildRequires: python3-setuptools -Requires: python3-azure-nspkg >= 3.0.0 +Requires: %{pythons}-azure-nspkg >= 3.0.0 Conflicts: azure-cli < 2.0.0 BuildArch: noarch @@ -48,17 +57,17 @@ It provides the necessary files for other packages to extend the azure cli names %build install -m 644 %{SOURCE1} %{_builddir}/azure-cli-nspkg-%{version} -python3 setup.py build +%pyproject_wheel %install -python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} -%fdupes %{buildroot}%{python3_sitelib} +%pyproject_install +%fdupes %{buildroot}%{_sitelibdir} %files %defattr(-,root,root,-) %doc README.rst %license LICENSE.txt -%{python3_sitelib}/azure/cli -%{python3_sitelib}/azure_cli_nspkg-*.egg-info +%{_sitelibdir}/azure/cli +%{_sitelibdir}/azure_cli_nspkg-*.dist-info %changelog