From 4c5b17ad50fcfcfa55ee559d1a86b63933ec7dd3 Mon Sep 17 00:00:00 2001 From: Deven Navani Date: Wed, 12 Feb 2025 22:35:28 +0000 Subject: [PATCH 1/5] try using pyproject.toml only --- pyproject.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 57 -------------------------------------------------- setup.py | 18 ---------------- 3 files changed, 54 insertions(+), 75 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index a9c7ad02e3..7748a37422 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,60 @@ 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 = "Apache-2.0" +license-files = ["LICENSE"] +authors = [ + { name = "Modal Labs", email = "support@modal.com" } +] +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] +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__"} + [tool.mypy] python_version = "3.11" exclude = "build" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 633a176093..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,57 +0,0 @@ -[metadata] -name = modal -author = Modal Labs -author_email = support@modal.com -description = Python client library for Modal -long_description = file: README.md -long_description_content_type = text/markdown -project_urls = - Homepage = https://modal.com - Source = https://github.com/modal-labs/modal-client -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 - -[options] -packages = find: -python_requires = >=3.9 -install_requires = - 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 - -[options.packages.find] -exclude = - test* - modal_docs/ - modal_global_objects/ - -[options.entry_points] -console_scripts = - modal = modal.__main__:main - -[options.package_data] -modal = - requirements/*.md - requirements/*.txt - requirements/*.json - py.typed - *.pyi -modal_proto = - *.proto - py.typed - *.pyi diff --git a/setup.py b/setup.py deleted file mode 100644 index ec3641a9d7..0000000000 --- a/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright Modal Labs 2022 -import os -import sys - -# Add current directory to the path -sys.path.append(os.getcwd()) - -# PEP 396 prescribes setting a __version__ on the package, -# but there's no obvious way for setup.py to access it. -# A workaround is to put it in a separate package with no dependencies on modal. -# TODO: might want to look at pbr: -# https://docs.openstack.org/pbr/latest/user/index.html - -from setuptools import setup # noqa - -from modal_version import __version__ # noqa - -setup(version=__version__) From 3079dddc72867c9455c135ecc3b539d7610860cb Mon Sep 17 00:00:00 2001 From: Deven Navani Date: Wed, 12 Feb 2025 22:41:48 +0000 Subject: [PATCH 2/5] fix license --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7748a37422..b7dcda2fc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,8 +8,8 @@ description = "Python client library for Modal" readme = "README.md" dynamic = ["version"] requires-python = ">=3.9" -license = "Apache-2.0" -license-files = ["LICENSE"] +license = {text = "Apache-2.0"} + authors = [ { name = "Modal Labs", email = "support@modal.com" } ] From 97bed12d4ade04cd530b2111f125f3f77e0771a5 Mon Sep 17 00:00:00 2001 From: Deven Navani Date: Wed, 12 Feb 2025 23:47:15 +0000 Subject: [PATCH 3/5] fix pyproject.toml --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7dcda2fc5..eb554feda3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,12 +47,16 @@ Documentation = "https://modal.com/docs" modal = "modal.__main__:main" [tool.setuptools.packages.find] -exclude = ["test*", "modal_docs/", "modal_global_objects/"] +include = ["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.exclude-package-data] +modal = ["test/*", "modal_docs/*", "modal_global_objects/*"] + [tool.setuptools.dynamic] version = {attr = "modal_version.__version__"} From e9c38d3d07d00fc74b656908feb909e62d8a2ef8 Mon Sep 17 00:00:00 2001 From: Deven Navani Date: Thu, 13 Feb 2025 01:38:40 +0000 Subject: [PATCH 4/5] fix pyproject.toml --- .github/workflows/ci-cd.yml | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 85d8d9a3b3..26855e1757 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -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: diff --git a/pyproject.toml b/pyproject.toml index eb554feda3..86c34f1fd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ Documentation = "https://modal.com/docs" modal = "modal.__main__:main" [tool.setuptools.packages.find] -include = ["modal", "modal_version", "modal_proto"] +include = ["modal", "modal_version", "modal_proto", "modal.*"] exclude = ["test*", "modal_docs", "modal_global_objects"] [tool.setuptools.package-data] From 4717adac589f7aa3153da429860d5193b24fe946 Mon Sep 17 00:00:00 2001 From: Deven Navani Date: Thu, 13 Feb 2025 02:16:09 +0000 Subject: [PATCH 5/5] more cleanup --- pyproject.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 86c34f1fd0..a5b05b0e80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,16 +47,13 @@ Documentation = "https://modal.com/docs" modal = "modal.__main__:main" [tool.setuptools.packages.find] -include = ["modal", "modal_version", "modal_proto", "modal.*"] +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.exclude-package-data] -modal = ["test/*", "modal_docs/*", "modal_global_objects/*"] - [tool.setuptools.dynamic] version = {attr = "modal_version.__version__"}