From 9d5bc35a63129a46bb09b51b75c2a55d6c6be7b3 Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Thu, 4 Jun 2026 10:21:53 -0500 Subject: [PATCH 1/2] move contents to pyproject.toml, keep only c-ext building --- sdk/storage/azure-storage-extensions/setup.py | 52 ++++--------------- 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/sdk/storage/azure-storage-extensions/setup.py b/sdk/storage/azure-storage-extensions/setup.py index ee5bae7cfb07..462a3390d4ab 100644 --- a/sdk/storage/azure-storage-extensions/setup.py +++ b/sdk/storage/azure-storage-extensions/setup.py @@ -4,10 +4,15 @@ # license information. # -------------------------------------------------------------------------- -import os -import re +# This file remains only for two things that setuptools cannot yet express +# declaratively in pyproject.toml without opting into experimental config: +# 1. Compiling the limited-API C extension(s). +# 2. Overriding bdist_wheel so wheels built against Py_LIMITED_API are +# tagged abi3 and become reusable across CPython 3.x versions. +# Can be removed once experimental is removed from https://github.com/pypa/setuptools/blob/84ed5913724df5a12dc804e1d5efe12508e706d2/setuptools/config/pyprojecttoml.py#L135 + from setuptools import setup, Extension -from wheel.bdist_wheel import bdist_wheel +from setuptools.command.bdist_wheel import bdist_wheel class bdist_wheel_abi3(bdist_wheel): @@ -21,51 +26,12 @@ def get_tag(self): return python, abi, plat -PACKAGE_NAME = "azure-storage-extensions" -PACKAGE_PPRINT_NAME = "Azure Storage Extensions" - -package_folder_path = PACKAGE_NAME.replace("-", "/") - -# Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, "checksums", "_version.py"), "r") as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - setup( - name=PACKAGE_NAME, - version=version, - description=PACKAGE_PPRINT_NAME, - long_description=open("README.md", "r", encoding="utf-8").read(), - long_description_content_type="text/markdown", - license="MIT", - author="Microsoft Corporation", - author_email="ascl@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-extensions", - keywords="azure, azure sdk", - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - python_requires=">=3.10", - packages=[ - "azure.storage.extensions.checksums", - ], ext_package="azure.storage.extensions.checksums", ext_modules=[ Extension( "crc64", - [os.path.join(package_folder_path, "checksums", "crc64", "crc64module.c")], + ["azure/storage/extensions/checksums/crc64/crc64module.c"], define_macros=[("Py_LIMITED_API", "3")], py_limited_api=True, ), From cc394c6cae50f082e4743ec82f3baaf6710c3ffb Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Thu, 4 Jun 2026 10:22:12 -0500 Subject: [PATCH 2/2] changes to pyproject.toml --- .../azure-storage-extensions/pyproject.toml | 56 ++++++++++++++++++- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-extensions/pyproject.toml b/sdk/storage/azure-storage-extensions/pyproject.toml index f4591da73f1c..907bccb503fb 100644 --- a/sdk/storage/azure-storage-extensions/pyproject.toml +++ b/sdk/storage/azure-storage-extensions/pyproject.toml @@ -1,3 +1,54 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +[build-system] +requires = ["setuptools>=77.0.3", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-storage-extensions" +authors = [ + { name = "Microsoft Corporation", email = "ascl@microsoft.com" }, +] +description = "Azure Storage Extensions" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = ["azure", "azure sdk"] +dynamic = ["version", "readme"] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-extensions" + +[tool.setuptools.dynamic] +version = { attr = "azure.storage.extensions.checksums._version.VERSION" } +readme = { file = ["README.md"], content-type = "text/markdown" } + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "samples*", + "doc*", + "azure", + "azure.storage", + "azure.storage.extensions", +] + +[tool.setuptools.package-data] +"azure.storage.extensions.checksums" = ["py.typed", "*.pyi"] + [tool.azure-sdk-build] mypy = false pyright = false @@ -12,9 +63,8 @@ breaking = false # these can be any number of suppressions. note that * present means that ALL warnings will be suppressed for this package suppressed_skip_warnings = ["*"] -[build-system] -# cibuildwheel is NOT a build-system dependency; it is the outer orchestration tool -requires = ["setuptools", "wheel"] +[tool.azure-sdk-conda] +in_bundle = false [tool.cibuildwheel] build = ["cp310*", "pp310*", "pp311*"]