Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from legacy setup.py+setup.cfg to pyproject.toml-based packaging #2869

Merged
merged 7 commits into from
Feb 14, 2025

Conversation

devennavani
Copy link
Contributor

@devennavani devennavani commented Feb 12, 2025

This PR updates our build system to use modern Python packaging standards by:

  • Migrating from setup.cfg and setup.py to pyproject.toml-based configuration
  • Switching from setuptools direct usage to the standardized build package for creating distributions

Changes

  • Moved all package metadata and configuration from setup.cfg to pyproject.toml using the [project] table format
  • Removed setup.py in favor of dynamic version detection via pyproject.toml (see tool.setuptools.dynamic)
  • Added explicit pip install build step in CI workflow to install Python's standardized build frontend: https://github.com/pypa/build
  • Updated CI/CD workflow to use python -m build instead of python setup.py sdist bdist_wheel

All package specifications (dependencies, entry points, package data, etc.) remain functionally equivalent to the previous configuration.

@devennavani devennavani changed the title try using pyproject.toml only Migrate from using legacy setup.py+setup.cfg to pyproject.toml Feb 13, 2025
@devennavani devennavani changed the title Migrate from using legacy setup.py+setup.cfg to pyproject.toml Migrate from legacy setup.py+setup.cfg to pyproject.toml-based packaging Feb 13, 2025
@devennavani devennavani marked this pull request as ready for review February 13, 2025 02:43
Copy link
Contributor

@erikbern erikbern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

modal_proto = ["*.proto", "py.typed", "*.pyi"]

[tool.setuptools.dynamic]
version = {attr = "modal_version.__version__"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need modal_version here? Seems like we could be dynamically getting the version from modal.__version__ (with that getting populated by some auto-generated file that lives under modal/).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we can probably eliminate the need for the separate package -- that change has a couple of touch points so I'll make it in a separate PR.

@devennavani devennavani merged commit 8736584 into main Feb 14, 2025
24 checks passed
@devennavani devennavani deleted the deven/use_pyproject_toml branch February 14, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants