Skip to content

Commit 4c44d08

Browse files
authored
fix: Switch to pyproject.toml based builds (#365)
* fix: Switch to `pyproject.toml` based builds * chore: Add newly supported Python versions (3.11 & 3.12) * fix: remove `setup.py` from linting steps * chore: disable Python 3.12 conformance tests
1 parent c0fa420 commit 4c44d08

File tree

4 files changed

+85
-71
lines changed

4 files changed

+85
-71
lines changed

.github/workflows/buildpack-integration-test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,29 @@ jobs:
5858
builder-runtime: 'python310'
5959
builder-runtime-version: '3.10'
6060
start-delay: 5
61+
python311:
62+
uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main
63+
with:
64+
http-builder-source: 'tests/conformance'
65+
http-builder-target: 'write_http_declarative'
66+
cloudevent-builder-source: 'tests/conformance'
67+
cloudevent-builder-target: 'write_cloud_event_declarative'
68+
prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
69+
builder-runtime: 'python311'
70+
builder-runtime-version: '3.11'
71+
start-delay: 5
72+
# Python 3.12 conformance tests are disabled due to the buildpack defaulting to
73+
# Ubuntu 18.04, which has no Python 3.12 version, and being unable to specify
74+
# the OS/stack via the conformance test configuration
75+
#
76+
# python312:
77+
# uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main
78+
# with:
79+
# http-builder-source: 'tests/conformance'
80+
# http-builder-target: 'write_http_declarative'
81+
# cloudevent-builder-source: 'tests/conformance'
82+
# cloudevent-builder-target: 'write_cloud_event_declarative'
83+
# prerun: 'tests/conformance/prerun.sh ${{ github.sha }}'
84+
# builder-runtime: 'python312'
85+
# builder-runtime-version: '3.12'
86+
# start-delay: 5

pyproject.toml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[project]
2+
name = "functions-framework"
3+
version = "3.8.2"
4+
description = "An open source FaaS (Function as a service) framework for writing portable Python functions -- brought to you by the Google Cloud Functions team."
5+
readme = "README.md"
6+
requires-python = ">=3.5, <4"
7+
# Once we drop support for Python 3.7 and 3.8, this can become
8+
# license = "Apache-2.0"
9+
license = {text = "Apache-2.0"}
10+
authors = [
11+
{ name = "Google LLC", email = "[email protected]" }
12+
]
13+
maintainers = [
14+
{ name = "Google LLC", email = "[email protected]" }
15+
]
16+
keywords = ["functions-framework"]
17+
classifiers = [
18+
"Development Status :: 5 - Production/Stable",
19+
"Intended Audience :: Developers",
20+
"Programming Language :: Python :: 3.7",
21+
"Programming Language :: Python :: 3.8",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
]
27+
dependencies = [
28+
"flask>=2.0,<4.0",
29+
"click>=7.0,<9.0",
30+
"watchdog>=1.0.0",
31+
"gunicorn>=22.0.0; platform_system!='Windows'",
32+
"cloudevents>=1.2.0,<2.0.0",
33+
"Werkzeug>=0.14,<4.0.0",
34+
]
35+
36+
[project.urls]
37+
Homepage = "https://github.com/googlecloudplatform/functions-framework-python"
38+
39+
[project.scripts]
40+
ff = "functions_framework._cli:_cli"
41+
functions-framework = "functions_framework._cli:_cli"
42+
functions_framework = "functions_framework._cli:_cli"
43+
functions-framework-python = "functions_framework._cli:_cli"
44+
functions_framework_python = "functions_framework._cli:_cli"
45+
46+
[build-system]
47+
requires = ["setuptools>=61.0.0"]
48+
build-backend = "setuptools.build_meta"
49+
50+
[tool.setuptools.packages.find]
51+
where = ["src"]
52+
53+
[tool.setuptools.package-data]
54+
functions_framework = ["py.typed"]
55+
56+
[tool.setuptools.package-dir]
57+
"" = "src"

setup.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ deps =
4242
mypy
4343
build
4444
commands =
45-
black --check src tests setup.py conftest.py --exclude tests/test_functions/background_load_error/main.py
46-
isort -c src tests setup.py conftest.py
45+
black --check src tests conftest.py --exclude tests/test_functions/background_load_error/main.py
46+
isort -c src tests conftest.py
4747
mypy tests/test_typing.py
4848
python -m build
4949
twine check dist/*

0 commit comments

Comments
 (0)