Port all packages from setup.py to pyproject.toml#45336
Draft
Port all packages from setup.py to pyproject.toml#45336
Conversation
- Add migration script at eng/scripts/migrate_setup_py_to_pyproject.py - Run migration on all 309 packages (279 migrated, 30 skipped) - Update packaging_tools template to generate pyproject.toml instead of setup.py - Update build_packaging_by_package_name to skip setup.py generation and remove existing setup.py files - Update generate_packaging_and_ci_files to always delete setup.py when pyproject.toml exists Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
…casing, merge remaining sdk_packaging.toml files Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Port all packages from setup.py to pyproject.toml
Port all packages from setup.py to pyproject.toml
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates 279 SDK packages from
setup.pyto PEP 621pyproject.tomlformat, removingsetup.pyandsdk_packaging.tomlfiles across the SDK. Also cleans up 23 orphanedsdk_packaging.tomlfiles from packages already usingpyproject.toml.Migration script
eng/scripts/migrate_setup_py_to_pyproject.py— new standalone migration tool:setup.pyvia AST + execution to extract all metadatapyproject.tomlwith[build-system],[project],[project.urls],[tool.setuptools.*]sections[packaging]fromsdk_packaging.tomland preserves existing[tool.*]settings (mypy, isort, azure-sdk-build, etc.)find_packages(exclude=[...])entries--dry-run,--keep-setup-py, single package (--package-path) or all (--all)Tooling updates
packaging_tools/templates/packaging_files/pyproject.toml— new Jinja2 template replacingsetup.pyfor future package scaffoldingpackaging_tools/__init__.py—build_packaging_by_package_namenow skipssetup.pygeneration, removes existingsetup.py, and merges into (rather than overwrites) existingpyproject.tomlpackaging_tools/generate_utils.py—generate_packaging_and_ci_filesunconditionally deletessetup.pywhenpyproject.tomlis presentResult
pyproject.tomlwith a[project]section (all parse correctly viaParsedSetup.from_path())setup.pyfiles: nspkg packages (27), deprecated meta-packages (azure,azure-mgmt,azure-keyvault), and C-extension package (azure-storage-extensions)Before:
After:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
ghcr.io/tmp/dependabot-cli/dependabot/dependabot /tmp/dependabot-cli/dependabot/dependabot graph pip org/repo --local /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python --branch main --directory sdk/advisor/azure-mgmt-advisor --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt /etc/ssl/certs/OISTE_WISeKey_Global_Root_GB_CA.pem /usr/bin/ln t.pem /var/run/docker//usr/bin/runc e ln(dns block)/tmp/dependabot-cli/dependabot/dependabot /tmp/dependabot-cli/dependabot/dependabot graph pip org/repo --local /tmp/dependabot-base-Ae3K0M/repo --branch main --directory sdk/advisor/azure-mgmt-advisor --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt /usr/share/ca-certificates/mozilla/OISTE_WISeKey_Global_Root_GB_CA.crt n/git-credential-store-immutable --file /home/dependabot/dependabot-updater/git.store t.pem /var/run/docker//usr/bin/runc /usr/bin/ln sed(dns block)/tmp/dependabot-cli/dependabot/dependabot /tmp/dependabot-cli/dependabot/dependabot graph pip org/repo --local /tmp/dependabot-base-Ae3K0M/repo --branch main --directory sdk/agrifood/azure-agrifood-farming --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt sed /usr/local/.pyenv/bin/test crt /usr/share/ca-ce-q test test(dns block)pypi.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/lib/python3.9/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-96eurjhp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=42 wheel k/azure-sdk-for---norc k/azure-sdk-for---noprofile k/azure-sdk-for-python/azure-sdk/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/sdk/networkfunction/azure-mgmt-networkfunction/pyproject.toml(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/pip pip install /tmp/test_migration/azure-data-tables/dist/azure_data_tables-12.8.0b1-py3-none-any.whl --quiet --no�� --noprofile python/azure-sdk-for-python/sdk/nspkg/azure-cognitiveservices-search-nspkg/pyproject.toml v/bin/bash tils.py age_properties.p--norc _checks.py stat k/az�� --format=%T python/azure-sdk-for-python/sdk/apimanagement/azure-mgmt-apimanagement/pyproject.toml rvices/setup.py uild.py .py lled_packages.py--noprofile bash(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/lib/python3.9/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-ryo16vic/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=42 wheel python/azure-sdk--norc /setup.py grep(dns block)scanning-api.github.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.