diff --git a/.gitignore b/.gitignore index 80a8fd1..050570e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /azure-mgmt-consumption-8.0.0.zip /azure-mgmt-consumption-2.0.0.zip -/azure-mgmt-consumption-2.0.0.tgz diff --git a/generate-source.sh b/generate-source.sh deleted file mode 100755 index 9ed2597..0000000 --- a/generate-source.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -export VERSION=2.0.0 -export PACKAGE_NAME=azure-mgmt-consumption -WORKING_DIR=$(pwd) - -# Download the release and unpack it. -curl -LO https://github.com/Azure/azure-sdk-for-python/archive/refs/tags/${PACKAGE_NAME}_${VERSION}.tar.gz -tar xzf ${PACKAGE_NAME}_${VERSION}.tar.gz - -# Find the package directory in the SDK release and the parent directory. -PACKAGE_DIR=$(find azure-sdk-for-python-${PACKAGE_NAME}_${VERSION} -type d -name $PACKAGE_NAME) -PARENT_DIR=$(dirname $PACKAGE_DIR) - -# Build a tarball with a prefix directory that contains the package name and -# version. Store that in the directory where the script is running. -pushd $PARENT_DIR - tar --transform "s/^${PACKAGE_NAME}/${PACKAGE_NAME}-${VERSION}/" -cz \ - -f ${WORKING_DIR}/${PACKAGE_NAME}-${VERSION}.tgz $PACKAGE_NAME -popd \ No newline at end of file diff --git a/python-azure-consumption-remove-nspkg.patch b/python-azure-consumption-remove-nspkg.patch new file mode 100644 index 0000000..eb731c1 --- /dev/null +++ b/python-azure-consumption-remove-nspkg.patch @@ -0,0 +1,10 @@ +diff -up ./setup.cfg.orig ./setup.cfg +--- ./setup.cfg.orig 2021-07-22 16:37:20.836524174 -0500 ++++ ./setup.cfg 2021-07-22 16:37:28.147481481 -0500 +@@ -1,6 +1,5 @@ + [bdist_wheel] + universal = 1 +-azure-namespace-package = azure-mgmt-nspkg + + [egg_info] + tag_build = diff --git a/python-azure-mgmt-consumption.spec b/python-azure-mgmt-consumption.spec index 9ad446b..efd3189 100644 --- a/python-azure-mgmt-consumption.spec +++ b/python-azure-mgmt-consumption.spec @@ -1,37 +1,22 @@ -# EPEL9 does not have python-aiohttp packaged yet. -%if 0%{?fedora} -%bcond_without tests -%else -%bcond_with tests -%endif - %global srcname azure-mgmt-consumption Name: python-%{srcname} Version: 2.0.0 -Release: %autorelease +Release: 4%{?dist} Summary: Microsoft Azure Consumption Client Library for Python License: MIT URL: https://pypi.org/project/%{srcname}/ -# This source comes from making a git archive of the main azure-sdk-for-python -# repository. To reproduce the source code, run the generate-source.sh script. -Source0: %{srcname}-%{version}.tgz +Source0: %{pypi_source %{srcname} %{version} zip} +Patch0: python-azure-consumption-remove-nspkg.patch Epoch: 1 BuildArch: noarch -BuildRequires: python3-devel -%if %{with tests} -BuildRequires: python3dist(azure-devtools) -BuildRequires: python3dist(azure-mgmt-keyvault) -BuildRequires: python3dist(azure-mgmt-resource) -BuildRequires: python3dist(azure-sdk-tools) -BuildRequires: python3dist(pytest) -BuildRequires: python3dist(pytest-aiohttp) -BuildRequires: python3dist(python-dotenv) -%endif +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros + %global _description %{expand: Microsoft Azure Consumption Client Library for Python} @@ -41,7 +26,7 @@ Microsoft Azure Consumption Client Library for Python} %package -n python3-%{srcname} Summary: %{summary} - +Obsoletes: python3-azure-sdk < 5.0.1 %description -n python3-%{srcname} %{_description} @@ -49,12 +34,11 @@ Summary: %{summary} %autosetup -p0 -n %{srcname}-%{version} # Remove the custom wheel builder. -sed -i '/azure-namespace-package/d' setup.cfg rm -fv azure_bdist_wheel.py %generate_buildrequires -%pyproject_buildrequires +%pyproject_buildrequires -r %build @@ -69,16 +53,6 @@ rm -fv azure_bdist_wheel.py rm -rf %{buildroot}%{python3_sitelib}/azure/{__init__.py,__pycache__} rm -rf %{buildroot}%{python3_sitelib}/azure/mgmt/{__init__.py,__pycache__} -%pyproject_save_files azure - - -%check -%pyproject_check_import - -%if %{with tests} -%pytest -%endif - %files -n python3-%{srcname} %doc README.rst HISTORY.rst @@ -87,4 +61,17 @@ rm -rf %{buildroot}%{python3_sitelib}/azure/mgmt/{__init__.py,__pycache__} %changelog -%autochangelog +* Wed Sep 08 2021 Major Hayden - 1:2.0.0-4 +- Move obsoletes into subpackage + +* Mon Jul 26 2021 Major Hayden - 1:2.0.0-3 +- Remove conflicting namespace package files + +* Fri Jul 23 2021 Major Hayden - 1:2.0.0-2 +- Add epoch number for 2.0.0 downgrade + +* Thu Jul 22 2021 Major Hayden - 2.0.0-1 +- Downgrade to 2.0.0 + +* Tue Jun 01 2021 Major Hayden - 8.0.0-1 +- First package. diff --git a/sources b/sources index 96fdd68..49897eb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (azure-mgmt-consumption-2.0.0.tgz) = dbf0350e76ca60e42fe5fa970b4ac691db7f44921e46f7d69962490db737c823e9044c657bb77082f6e35eb7f887ab03be418eadfa09de4fae851fab8ced4342 +SHA512 (azure-mgmt-consumption-2.0.0.zip) = 57879641214bfb5faa347d23be6e8149cf676e487bc18b2d588abaa4f7d27b6b93d74d098e8ce45aa451de97a01c102b1a56dbd83c8fb21641d6cb9868bc5427