Chore: Migrate to pyproject.toml#877
Merged
ftnext merged 10 commits intoUberi:masterfrom Mar 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the project’s packaging configuration from setup.py/setup.cfg to a PEP 621-style pyproject.toml, consolidating build metadata, dependencies, and extras into a single modern packaging file.
Changes:
- Removed legacy
setup.py-based packaging configuration. - Removed
setup.cfgextras definition in favor ofpyproject.toml. - Added
pyproject.tomlwith project metadata, dependencies/extras, console script entry point, and setuptools configuration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
setup.py |
Removed setuptools-based packaging script in favor of pyproject.toml. |
setup.cfg |
Removed extras definitions migrated to pyproject.toml. |
pyproject.toml |
Added build-system + PEP 621 project metadata, dependencies, optional-dependencies, and setuptools configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
supported by GPT 5.4
Packaging migration notes
This branch started as a packaging migration from the legacy
setup.py/setup.cfglayout to apyproject.toml-based configuration, and the later commits in this review cycle focused on preserving compatibility and avoiding migration regressions.Initial migration on this branch
The initial migration work on this branch already did the following:
setup.py/setup.cfgintopyproject.toml.project.optional-dependencies.project.scripts.pyproject.toml.setup.cfgpackaging configuration.setup.pyas part of the migration.Review-driven follow-up decisions
During review, the following decisions were made and applied in order to keep the migration safe and compatible:
Switched dynamic version loading from
attrtofile.tool.setuptools.dynamic.versionnow reads fromspeech_recognition/version.txt.speech_recognitionat build time.Kept
__version__as a runtime attribute, but did not expand dynamic metadata usage to other dunder attributes.__version__remains commonly useful at runtime.__author__and__license__are kept as compatibility-oriented module attributes for now.Added
speech_recognition/version.txtas package data.Changed
project.licensetolicense = { file = "LICENSE.txt" }.[1]Updated the end-user installation command in
README.rst.python setup.py installwithpython -m pip install ..Restored a minimal
setup.pycompatibility shim:from setuptools import setup; setup()python setup.py bdist_wheelpath while the repository still contains older release tooling and documentation references.Disabled implicit namespace package discovery.
namespaces = falseundertool.setuptools.packages.find.find_packages()behavior and avoids unintentionally shipping unrelated directories.Relaxed the build requirement from
setuptools>=68tosetuptools>=61.>=61is sufficient as an early PEP 621-compatible baseline and avoids an unnecessarily strict toolchain floor.Dropped the explicit
wheelbuild requirement.setuptools.build_metadoes not needwheellisted explicitly here.Removed redundant
include-package-data = true.pyproject.toml, this setting is already the default in setuptools.Decisions intentionally deferred
Some concerns were discussed but intentionally left out of this PR:
Offline
pip install .behavior under PEP 517 build isolation is not fully addressed here.wheelrequirement help reduce unnecessary strictness, but they do not eliminate the broader isolated-build behavior introduced bypyproject.tomlbuilds.The release workflow is not fully modernized in this PR.
make distributeandmake publish.setup.pyshim for compatibility instead of trying to clean up the entire release flow at once.The runtime
__version__implementation is not being redesigned further in this PR.Planned follow-ups
The following work is better handled separately from this migration PR:
make distribute/make publishworkflow.make-release.shshould be removed or rewritten around modern PEP 517 build commands.--no-build-isolation) or handled with a broader packaging policy change.[1]: Also fixes this: