Skip to content

Commit 22c34e6

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-functions-python-worker into hallvictoria/generic-typing
2 parents 2a244c0 + 8374548 commit 22c34e6

File tree

161 files changed

+11463
-409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+11463
-409
lines changed

.flake8

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
ignore = W503,E402,E731
77

88
exclude = .git, __pycache__, build, dist, .eggs, .github, .local, docs/,
9-
Samples, azure_functions_worker/protos/, proxy_worker/protos/,
10-
azure_functions_worker/_thirdparty/typing_inspect.py,
11-
tests/unittests/test_typing_inspect.py,
12-
tests/unittests/broken_functions/syntax_error/main.py,
13-
.env*, .vscode, venv*, *.venv*
9+
Samples, workers/azure_functions_worker/protos/, workers/proxy_worker/protos/,
10+
workers/azure_functions_worker/_thirdparty/typing_inspect.py,
11+
workers/tests/unittests/test_typing_inspect.py,
12+
workers/tests/unittests/broken_functions/syntax_error/main.py,
13+
.env*, .vscode, venv*, *.venv*,
14+
runtimes/v2/tests/protos/*,
15+
runtimes/v2/azure_functions_runtime/utils/typing_inspect.py,
16+
runtimes/v1/tests/protos/*,
17+
runtimes/v1/azure_functions_runtime_v1/utils/typing_inspect.py
1418

15-
max-line-length = 88
19+
max-line-length = 88

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ If yes, please answer the following:
3232
- [ ] Does this change apply to both Python <=3.12 and 3.13+?
3333
- If yes, have the changes been made to:
3434
- [ ] azure_functions_worker (Python <= 3.12)
35-
- [ ] azure_functions_worker_v1 / azure_functions_worker_v2 (Python >= 3.13)
35+
- [ ] runtimes/v1 / runtimes/v2 (Python >= 3.13)
3636
- If no, please explain why:
3737

3838
**Programming Model Compatibility (for Python 3.13+)**
3939
- Does this change apply to both:
40-
- [ ] V1 programming model (azure_functions_worker_v1)?
41-
- [ ] V2 programming model (azure_functions_worker_v2)?
40+
- [ ] V1 programming model (runtimes/v1)?
41+
- [ ] V2 programming model (runtimes/v2)?
4242
- Explanation (if limited to one model):
4343

4444
<!-- Thanks for using the checklist -->

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,8 @@ prof/
132132
tests/**/host.json
133133
tests/**/bin
134134
tests/**/extensions.csproj
135+
136+
# Azurite related files
137+
__blobstorage__/*
138+
__queuestorage__/*
139+
__azurite*

eng/ci/code-mirror.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ trigger:
22
branches:
33
include:
44
- dev
5-
- release/*
5+
- release* # proxy & library worker releases
66
- sdk/* # run for sdk and extension release branches
77
- extensions/*
88

eng/ci/emulator-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pr:
99
branches:
1010
include:
1111
- dev
12-
- release/*
12+
- release*
1313

1414
schedules:
1515
- cron: "0 8 * * 1,2,3,4,5"

eng/ci/integration-tests.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pr:
99
branches:
1010
include:
1111
- dev
12-
- release/*
12+
- release*
1313

1414
schedules:
1515
- cron: "0 8 * * 1,2,3,4,5"
@@ -47,8 +47,7 @@ extends:
4747
dependsOn: []
4848
jobs:
4949
- template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
50-
# Skipping consumption tests till pipeline is fixed
51-
# - stage: RunLCTests
52-
# dependsOn: []
53-
# jobs:
54-
# - template: /eng/templates/official/jobs/ci-lc-tests.yml@self
50+
- stage: RunLCTests
51+
dependsOn: []
52+
jobs:
53+
- template: /eng/templates/official/jobs/ci-lc-tests.yml@self

eng/ci/official-build.yml

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ trigger:
33
branches:
44
include:
55
- dev
6-
- release/*
6+
- release/* # proxy worker releases
7+
- release-v1/* # V1 worker releases
8+
- release-v2/* # V2 worker releases
79

810
# CI only, does not trigger on PRs.
911
pr: none
@@ -46,34 +48,71 @@ extends:
4648
break: true
4749

4850
stages:
49-
- stage: Build
51+
# Python Worker Build and Test Stages
52+
- stage: BuildPythonWorker
5053
jobs:
5154
- template: /eng/templates/official/jobs/build-artifacts.yml@self
52-
53-
- stage: RunE2ETests
54-
dependsOn: Build
55+
- stage: RunWorkerE2ETests
56+
dependsOn: BuildPythonWorker
5557
jobs:
5658
- template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
57-
- stage: RunEmulatorTests
58-
dependsOn: Build
59+
- stage: RunWorkerEmulatorTests
60+
dependsOn: BuildPythonWorker
5961
jobs:
6062
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
6163
parameters:
6264
PoolName: 1es-pool-azfunc
63-
- stage: RunUnitTests
64-
dependsOn: Build
65+
- stage: RunWorkerUnitTests
66+
dependsOn: BuildPythonWorker
6567
jobs:
6668
- template: /eng/templates/jobs/ci-unit-tests.yml@self
67-
- stage: RunDockerConsumptionTests
68-
dependsOn: Build
69+
parameters:
70+
PoolName: 1es-pool-azfunc
71+
- stage: RunWorkerDockerConsumptionTests
72+
dependsOn: BuildPythonWorker
6973
jobs:
7074
- template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self
71-
- stage: RunDockerDedicatedTests
72-
dependsOn: Build
75+
- stage: RunWorkerDockerDedicatedTests
76+
dependsOn: BuildPythonWorker
7377
jobs:
7478
- template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self
75-
# Skipping consumption tests till pipeline is fixed
76-
# - stage: RunLinuxConsumptionTests
77-
# dependsOn: Build
78-
# jobs:
79-
# - template: /eng/templates/official/jobs/ci-lc-tests.yml@self
79+
- stage: RunWorkerLinuxConsumptionTests
80+
dependsOn: BuildPythonWorker
81+
jobs:
82+
- template: /eng/templates/official/jobs/ci-lc-tests.yml@self
83+
84+
# Python V2 Library Build and Test Stages
85+
- stage: BuildV2Library
86+
dependsOn: []
87+
jobs:
88+
- template: /eng/templates/official/jobs/build-library.yml@self
89+
parameters:
90+
PROJECT_NAME: 'Python V2 Library'
91+
PROJECT_DIRECTORY: 'runtimes/v2'
92+
ARTIFACT_NAME: 'azure-functions-runtime'
93+
- stage: RunV2LibraryUnitTests
94+
dependsOn: BuildV2Library
95+
jobs:
96+
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
97+
parameters:
98+
PROJECT_NAME: 'Python V2 Library'
99+
PROJECT_DIRECTORY: 'runtimes/v2'
100+
PoolName: 1es-pool-azfunc
101+
102+
# Python V1 Library Build and Test Stages
103+
- stage: BuildV1Library
104+
dependsOn: []
105+
jobs:
106+
- template: /eng/templates/official/jobs/build-library.yml@self
107+
parameters:
108+
PROJECT_NAME: 'Python V1 Library'
109+
PROJECT_DIRECTORY: 'runtimes/v1'
110+
ARTIFACT_NAME: 'azure-functions-runtime-v1'
111+
- stage: RunV1LibraryUnitTests
112+
dependsOn: BuildV1Library
113+
jobs:
114+
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
115+
parameters:
116+
PROJECT_NAME: 'Python V1 Library'
117+
PROJECT_DIRECTORY: 'runtimes/v1'
118+
PoolName: 1es-pool-azfunc

eng/ci/public-build.yml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,64 @@ extends:
4949
skipBuildTagsForGitHubPullRequests: ${{ variables['System.PullRequest.IsFork'] }}
5050

5151
stages:
52-
- stage: Build
52+
# Python Worker Build and Test Stages
53+
- stage: BuildPythonWorker
5354
jobs:
5455
- template: /eng/templates/jobs/build.yml@self
56+
parameters:
57+
PYTHON_VERSION: '3.11'
58+
PROJECT_NAME: 'Azure Functions Python Worker'
59+
PROJECT_DIRECTORY: 'workers'
5560
# Skip the build stage for SDK and Extensions release branches. This stage will fail because pyproject.toml contains the updated (and unreleased) library version
5661
condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false))
57-
- stage: RunUnitTests
58-
dependsOn: Build
62+
- stage: RunWorkerUnitTests
63+
dependsOn: BuildPythonWorker
5964
jobs:
6065
- template: /eng/templates/jobs/ci-unit-tests.yml@self
61-
- stage: RunEmulatorTests
62-
dependsOn: Build
66+
parameters:
67+
PROJECT_DIRECTORY: 'workers'
68+
PoolName: 1es-pool-azfunc-public
69+
- stage: RunWorkerEmulatorTests
70+
dependsOn: BuildPythonWorker
6371
jobs:
6472
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
6573
parameters:
74+
PoolName: 1es-pool-azfunc-public
75+
76+
# Python V2 Library Build and Test Stages
77+
- stage: BuildV2Library
78+
dependsOn: []
79+
jobs:
80+
- template: /eng/templates/jobs/build.yml@self
81+
parameters:
82+
PYTHON_VERSION: '3.13'
83+
PROJECT_NAME: 'V2 Library'
84+
PROJECT_DIRECTORY: 'runtimes/v2'
85+
- stage: RunV2LibraryUnitTests
86+
dependsOn: BuildV2Library
87+
jobs:
88+
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
89+
parameters:
90+
PROJECT_NAME: 'V2 Library'
91+
PROJECT_DIRECTORY: 'runtimes/v2'
92+
PoolName: 1es-pool-azfunc-public
93+
94+
95+
96+
# Python V1 Library Build and Test Stages
97+
- stage: BuildV1Library
98+
dependsOn: []
99+
jobs:
100+
- template: /eng/templates/jobs/build.yml@self
101+
parameters:
102+
PYTHON_VERSION: '3.13'
103+
PROJECT_NAME: 'V1 Library'
104+
PROJECT_DIRECTORY: 'runtimes/v1'
105+
- stage: RunV1LibraryUnitTests
106+
dependsOn: BuildV1Library
107+
jobs:
108+
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
109+
parameters:
110+
PROJECT_NAME: 'V1 Library'
111+
PROJECT_DIRECTORY: 'runtimes/v1'
66112
PoolName: 1es-pool-azfunc-public

eng/ci/worker-release.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
pr: none
22

3+
parameters:
4+
- name: WorkerRelease
5+
displayName: 'Worker Release (Nuget)'
6+
type: boolean
7+
default: false
8+
- name: V1LibraryRelease
9+
displayName: 'V1 Library Release (PyPI)'
10+
type: boolean
11+
default: false
12+
- name: V2LibraryRelease
13+
displayName: 'V2 Library Release (PyPI)'
14+
type: boolean
15+
default: false
16+
317
resources:
418
repositories:
519
- repository: 1es
@@ -24,6 +38,30 @@ extends:
2438
os: windows
2539

2640
stages:
27-
- stage: Release
41+
- stage: ReleasePythonWorker
42+
displayName: 'Release Python Worker (Nuget)'
2843
jobs:
2944
- template: /eng/templates/official/jobs/publish-release.yml@self
45+
condition: eq(${{ parameters.WorkerRelease }}, True)
46+
- stage: ReleasePythonV2Library
47+
dependsOn: []
48+
displayName: 'Release V2 Library (PyPI)'
49+
jobs:
50+
- template: /eng/templates/official/jobs/publish-library-release.yml@self
51+
parameters:
52+
PROJECT_DIRECTORY: 'runtimes/v2'
53+
PROJECT_NAME: 'azure-functions-runtime'
54+
BRANCH_NAME: 'release-v2'
55+
TEST_BRANCH_NAME: 'test-release-v2'
56+
condition: eq(${{ parameters.V2LibraryRelease }}, True)
57+
- stage: ReleasePythonV1Library
58+
dependsOn: []
59+
displayName: 'Release V1 Library (PyPI)'
60+
jobs:
61+
- template: /eng/templates/official/jobs/publish-library-release.yml@self
62+
parameters:
63+
PROJECT_DIRECTORY: 'runtimes/v1'
64+
PROJECT_NAME: 'azure-functions-runtime-v1'
65+
BRANCH_NAME: 'release-v1'
66+
TEST_BRANCH_NAME: 'test-release-v1'
67+
condition: eq(${{ parameters.V1LibraryRelease }}, True)
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/bash
22

33
python -m pip install --upgrade pip
4+
python -m pip install -e runtimes/v2
5+
python -m pip install -e runtimes/v1
46
python -m pip install -U azure-functions --pre
5-
python -m pip install -U -e workers/[dev]
7+
python -m pip install -U -e $2/[dev]
68

79
if [[ $1 != "3.7" ]]; then
8-
python -m pip install --pre -U -e workers/[test-http-v2]
10+
python -m pip install --pre -U -e $2/[test-http-v2]
911
fi
1012
if [[ $1 != "3.7" && $1 != "3.8" ]]; then
11-
python -m pip install --pre -U -e workers/[test-deferred-bindings]
13+
python -m pip install --pre -U -e $2/[test-deferred-bindings]
1214
fi

0 commit comments

Comments
 (0)