From ff725fdec8c997a2ef0200aa8ff9134aa747d783007378cf235227f4509282e7 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Thu, 4 Apr 2024 20:56:56 +0000 Subject: [PATCH] Accepting request 1164960 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/1164960 OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/azure-cli-telemetry?expand=0&rev=19 --- azure-cli-telemetry.changes | 12 +++++++++++ azure-cli-telemetry.spec | 43 ++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/azure-cli-telemetry.changes b/azure-cli-telemetry.changes index d82f034..275ae41 100644 --- a/azure-cli-telemetry.changes +++ b/azure-cli-telemetry.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Apr 4 13:16:55 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 + ------------------------------------------------------------------- Mon Aug 14 13:13:14 UTC 2023 - John Paul Adrian Glaubitz diff --git a/azure-cli-telemetry.spec b/azure-cli-telemetry.spec index d5922ed..1c9e393 100644 --- a/azure-cli-telemetry.spec +++ b/azure-cli-telemetry.spec @@ -1,7 +1,7 @@ # # spec file for package azure-cli-telemetry # -# Copyright (c) 2023 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-telemetry Version: 1.1.0 Release: 0 @@ -25,17 +32,19 @@ Group: System/Management URL: https://github.com/Azure/azure-cli Source: https://files.pythonhosted.org/packages/source/a/azure-cli-telemetry/azure-cli-telemetry-%{version}.tar.gz Source1: LICENSE.txt +BuildRequires: %{pythons}-azure-nspkg >= 3.0.0 +BuildRequires: %{pythons}-pip +BuildRequires: %{pythons}-setuptools +BuildRequires: %{pythons}-wheel BuildRequires: azure-cli-nspkg BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: python3-azure-nspkg >= 3.0.0 -BuildRequires: python3-setuptools +Requires: %{pythons}-applicationinsights < 0.12 +Requires: %{pythons}-applicationinsights >= 0.11.1 +Requires: %{pythons}-azure-nspkg >= 3.0.0 +Requires: %{pythons}-portalocker < 3.0 +Requires: %{pythons}-portalocker >= 1.6 Requires: azure-cli-nspkg -Requires: python3-applicationinsights < 0.12 -Requires: python3-applicationinsights >= 0.11.1 -Requires: python3-azure-nspkg >= 3.0.0 -Requires: python3-portalocker < 3.0 -Requires: python3-portalocker >= 1.6 Conflicts: azure-cli < 2.0.0 BuildArch: noarch @@ -54,21 +63,21 @@ This package includes: %build install -m 644 %{SOURCE1} %{_builddir}/azure-cli-telemetry-%{version} -python3 setup.py build +%pyproject_wheel %install -python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} -%fdupes %{buildroot}%{python3_sitelib} -rm -rf %{buildroot}%{python3_sitelib}/azure/cli/__init__.* -rm -rf %{buildroot}%{python3_sitelib}/azure/cli/__pycache__ -rm -rf %{buildroot}%{python3_sitelib}/azure/__init__.* -rm -rf %{buildroot}%{python3_sitelib}/azure/__pycache__ +%pyproject_install +%fdupes %{buildroot}%{_sitelibdir} +rm -rf %{buildroot}%{_sitelibdir}/azure/cli/__init__.* +rm -rf %{buildroot}%{_sitelibdir}/azure/cli/__pycache__ +rm -rf %{buildroot}%{_sitelibdir}/azure/__init__.* +rm -rf %{buildroot}%{_sitelibdir}/azure/__pycache__ %files %defattr(-,root,root,-) %doc HISTORY.rst README.rst %license LICENSE.txt -%{python3_sitelib}/azure/cli/telemetry -%{python3_sitelib}/azure_cli_telemetry-*.egg-info +%{_sitelibdir}/azure/cli/telemetry +%{_sitelibdir}/azure_cli_telemetry-*.dist-info %changelog