Skip to content

Commit cfa0691

Browse files
authored
Merge branch 'main' into dl-async
2 parents fe73e7d + c0fa420 commit cfa0691

File tree

4 files changed

+98
-6
lines changed

4 files changed

+98
-6
lines changed

.github/workflows/conformance.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ permissions: read-all
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
1413
strategy:
1514
matrix:
16-
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
15+
python: ['3.9', '3.10', '3.11', '3.12']
16+
platform: [ubuntu-latest]
17+
include:
18+
- platform: ubuntu-22.04
19+
python: '3.8'
20+
- platform: ubuntu-22.04
21+
python: '3.7'
22+
runs-on: ${{ matrix.platform }}
1723
steps:
1824
- name: Harden Runner
1925
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1

.github/workflows/unit.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Python Unit CI
2-
on:
2+
on:
33
push:
44
branches:
55
- main
@@ -13,22 +13,31 @@ jobs:
1313
matrix:
1414
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1515
platform: [ubuntu-latest, macos-latest, windows-latest]
16-
# Python <= 3.9 is not available on macos-14
16+
# Python <= 3.9 is not available on macos-latest
1717
# Workaround for https://github.com/actions/setup-python/issues/696
18+
# Python <= 3.8 is not available on ubuntu-latest
1819
exclude:
1920
- platform: macos-latest
2021
python: '3.9'
2122
- platform: macos-latest
2223
python: '3.8'
2324
- platform: macos-latest
2425
python: '3.7'
26+
- platform: ubuntu-latest
27+
python: '3.8'
28+
- platform: ubuntu-latest
29+
python: '3.7'
2530
include:
2631
- platform: macos-latest
2732
python: '3.9'
2833
- platform: macos-13
2934
python: '3.8'
3035
- platform: macos-13
3136
python: '3.7'
37+
- platform: ubuntu-22.04
38+
python: '3.8'
39+
- platform: ubuntu-22.04
40+
python: '3.7'
3241
runs-on: ${{ matrix.platform }}
3342
steps:
3443
- name: Harden Runner
@@ -39,7 +48,9 @@ jobs:
3948
allowed-endpoints: >
4049
auth.docker.io:443
4150
files.pythonhosted.org:443
51+
api.github.com:443
4252
github.com:443
53+
objects.githubusercontent.com:443
4354
production.cloudflare.docker.com:443
4455
pypi.org:443
4556
registry-1.docker.io:443

DEVELOPMENT.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Development
2+
3+
Quickstart for functions-framework maintainers.
4+
5+
## Environment setup
6+
7+
Install [tox](https://pypi.org/p/tox), the test runner:
8+
9+
```
10+
$ python -m pip install -U tox
11+
```
12+
13+
## Running linting
14+
15+
Linting can be run with:
16+
17+
```
18+
$ python -m tox -e lint
19+
```
20+
21+
## Running tests
22+
23+
All tests can be run with:
24+
25+
```
26+
$ python -m tox
27+
```
28+
29+
Tests for the current Python version can be run with:
30+
31+
```
32+
$ python -m tox -e py
33+
```
34+
35+
Tests for a specific Python version can be run with:
36+
37+
```
38+
$ python -m tox -e py3.12
39+
```
40+
41+
A specific test file (e.g. `tests/test_cli.py`) can be run with:
42+
43+
```
44+
$ python -m tox -e py -- tests/test_cli.py
45+
```
46+
47+
A specific test in the file (e.g. `test_cli_no_arguements` in `tests/test_cli.py`) can be run with:
48+
49+
```
50+
$ python -m tox -e py -- tests/test_cli.py::test_cli_no_arguments
51+
```
52+
53+
## Releasing
54+
55+
Releases are triggered via the [Release Please](https://github.com/apps/release-please) app, which in turn kicks off the [Release to PyPI](https://github.com/GoogleCloudPlatform/functions-framework-python/blob/main/.github/workflows/release.yml) workflow.

tox.ini

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
[tox]
2-
envlist = py{35,36,37,38,39,310}-{ubuntu-latest,macos-latest,windows-latest},lint
2+
envlist =
3+
lint
4+
py312-ubuntu-latest
5+
py312-macos-latest
6+
py312-windows-latest
7+
py311-ubuntu-latest
8+
py311-macos-latest
9+
py311-windows-latest
10+
py310-ubuntu-latest
11+
py310-macos-latest
12+
py310-windows-latest
13+
py39-ubuntu-latest
14+
py39-macos-13
15+
py39-windows-latest
16+
py38-ubuntu-22.04
17+
py38-macos-13
18+
py38-windows-latest
19+
py37-ubuntu-22.04
20+
py37-macos-13
21+
py37-windows-latest
322

423
[testenv]
524
usedevelop = true
@@ -22,10 +41,11 @@ deps =
2241
twine
2342
isort
2443
mypy
44+
build
2545
extras = async
2646
commands =
2747
black --check src tests setup.py conftest.py --exclude tests/test_functions/background_load_error/main.py
2848
isort -c src tests setup.py conftest.py
2949
mypy tests/test_typing.py
30-
python setup.py --quiet sdist bdist_wheel
50+
python -m build
3151
twine check dist/*

0 commit comments

Comments
 (0)