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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ jobs:

- name: Build type stubs
run: inv type-stubs

- name: Install build
run: pip install build

- name: Build package distributions (wheel and source)
run: |
python setup.py sdist bdist_wheel
python -m build

- name: Upload to PyPI
env:
Expand Down
55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "modal"
description = "Python client library for Modal"
readme = "README.md"
dynamic = ["version"]
requires-python = ">=3.9"
license = {text = "Apache-2.0"}

authors = [
{ name = "Modal Labs", email = "[email protected]" }
]
dependencies = [
"aiohttp",
"certifi",
"click>=8.1.0",
"fastapi",
"grpclib==0.4.7",
"protobuf>=3.19,<6.0,!=4.24.0",
"rich>=12.0.0",
"synchronicity~=0.9.10",
"toml",
"typer>=0.9",
"types-certifi",
"types-toml",
"watchfiles",
"typing_extensions~=4.6"
]
keywords = ["modal", "client", "cloud", "serverless", "infrastructure"]
classifiers = [
"Topic :: System :: Distributed Computing",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3"
]

[project.urls]
Homepage = "https://modal.com"
Source = "https://github.com/modal-labs/modal-client"
Documentation = "https://modal.com/docs"
"Issue Tracker" = "https://github.com/modal-labs/modal-client/issues"

[project.scripts]
modal = "modal.__main__:main"

[tool.setuptools.packages.find]
include = ["modal", "modal.*", "modal_version", "modal_proto"]
exclude = ["test*", "modal_docs", "modal_global_objects"]

[tool.setuptools.package-data]
modal = ["requirements/*.md", "requirements/*.txt", "requirements/*.json", "py.typed", "*.pyi"]
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.


[tool.mypy]
python_version = "3.11"
exclude = "build"
Expand Down
57 changes: 0 additions & 57 deletions setup.cfg

This file was deleted.

18 changes: 0 additions & 18 deletions setup.py

This file was deleted.

Loading