Skip to content

Commit 4b46140

Browse files
authored
build: refactor afw & proxy into workers/ (#1702)
* initial refactoring * revert workers. changes * logging * oops * logging * reinstall * reinstall only binary * remove only binary * python path as env var * remove proxy worker * remove from sys modules * add back proxy, pip install workers/[dev] * clear sys modules * set working directory * fix working dir * move everything into workers/ * correct working dir * fix scripts * i am trying so hard here * seriously * deleting at the start? * there is literally no way * sigh * everything is FINE * adding missed files * feedback + PR template
1 parent 203fb4c commit 4b46140

File tree

693 files changed

+1981
-1986
lines changed

Some content is hidden

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

693 files changed

+1981
-1986
lines changed

.ci/e2e_integration_test/start-e2e.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Write-Host "--------------------------------------------------------------------
8888
Write-Host "Preparing E2E integration tests..." -ForegroundColor Green
8989
Write-Host "-----------------------------------------------------------------------------`n" -ForegroundColor Green
9090
python -m pip install -U pip
91-
python -m pip install -U -e .[dev]
92-
cd tests
91+
python -m pip install -U -e workers/[dev]
92+
cd workers/tests
9393
python -m invoke -c test_setup build-protos
9494
python -m invoke -c test_setup extensions
9595
Write-Host "-----------------------------------------------------------------------------`n" -ForegroundColor Green

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,33 @@ This checklist is used to make sure that common issues in a pull request are add
1212
This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
1313
-->
1414

15-
### PR information
16-
<!-- You can mark the following checkboxes as [x] to mark them during the PR creation itself. -->
17-
- [ ] The title of the PR is clear and informative.
18-
- [ ] There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).
19-
- [ ] If applicable, the PR references the bug/issue that it fixes in the description.
20-
- [ ] New Unit tests were added for the changes made and CI is passing.
21-
22-
### Quality of Code and Contribution Guidelines
23-
- [ ] I have read the [contribution guidelines](https://github.com/Azure/azure-functions-python-worker/blob/master/.github/CONTRIBUTING.md).
15+
## Pull Request Checklist
16+
<!--
17+
Please fill out the following checklist to ensure compatibility across Python versions and programming models.
18+
You can mark the following checkboxes as [x] to mark them during the PR creation itself.
19+
-->
20+
### Host-Worker Contract
21+
- [ ] Does this PR impact the host-worker contract (e.g., gRPC messages, shared interfaces)?
22+
- If yes, have the changes been applied to:
23+
- [ ] azure_functions_worker (Python <= 3.12)
24+
- [ ] proxy_worker (Python >= 3.13)
25+
- If no, please explain why:
26+
27+
### Worker Execution Logic
28+
- [ ] Does this PR affect worker execution logic (e.g., function invocation, bindings, lifecycle)?
29+
If yes, please answer the following:
30+
31+
**Python Version Coverage**
32+
- [ ] Does this change apply to both Python <=3.12 and 3.13+?
33+
- If yes, have the changes been made to:
34+
- [ ] azure_functions_worker (Python <= 3.12)
35+
- [ ] azure_functions_worker_v1 / azure_functions_worker_v2 (Python >= 3.13)
36+
- If no, please explain why:
37+
38+
**Programming Model Compatibility (for Python 3.13+)**
39+
- Does this change apply to both:
40+
- [ ] V1 programming model (azure_functions_worker_v1)?
41+
- [ ] V2 programming model (azure_functions_worker_v2)?
42+
- Explanation (if limited to one model):
2443

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ py3env/
105105
*.nupkg
106106

107107
.testconfig
108+
*/.testconfig
108109
.pytest_cache
109110

110111
# vscode

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
55
| dev | [![Build Status](https://img.shields.io/azure-devops/build/azfunc/public/658/dev)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=658&branchName=dev) | [![codecov](https://codecov.io/gh/Azure/azure-functions-python-worker/branch/dev/graph/badge.svg)](https://codecov.io/gh/Azure/azure-functions-python-worker) | [![Test Status](https://img.shields.io/azure-devops/build/azfunc/public/658/dev)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=658&branchName=dev) |
66

7-
Python support for Azure Functions is based on Python 3.8, 3.9, 3.10, 3.11, and 3.12 serverless hosting on Linux and the Functions 4.0 runtime.
7+
Python support for Azure Functions is based on Python 3.10, 3.11, 3.12, and 3.13 serverless hosting on Linux and the Functions 4.0 runtime.
88

99
Here is the current status of Python in Azure Functions:
1010

1111
What are the supported Python versions?
1212

13-
| Azure Functions Runtime | Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | Python 3.12 |
14-
|----------------------------------|------------|------------|-------------|-------------|-------------|
15-
| Azure Functions 3.0 (deprecated) ||| - | - | - |
16-
| Azure Functions 4.0 ||||||
13+
| Azure Functions Runtime | Python 3.10 | Python 3.11 | Python 3.12 | Python 3.13 |
14+
|----------------------------------|------------|------------|-------------|-------------|
15+
| Azure Functions 4.0 |||||
1716

1817
For information about Azure Functions Runtime, please refer to [Azure Functions runtime versions overview](https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions) page.
1918

eng/pack/Microsoft.Azure.Functions.V4.PythonWorker.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<file src="..\..\3.13_OSX_X64\**" target="tools\3.13\OSX\X64" />
4949
<file src="..\..\3.13_OSX_ARM64\**" target="tools\3.13\OSX\Arm64" />
5050
<file src="..\..\3.13_LINUX_ARM64\**" target="tools\3.13\LINUX\Arm64" />
51-
<file src="..\..\python\prodV4\worker.config.json" target="tools" />
51+
<file src="..\..\workers\python\prodV4\worker.config.json" target="tools" />
5252
<file src="Microsoft.Azure.Functions.PythonWorker.targets" target="build" />
5353
<file src="..\..\_manifest\spdx_2.2\manifest.spdx.json" target="SBOM\manifest.spdx.json" />
5454
</files>

eng/pack/scripts/mac_arm64_deps.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python -m venv .env
44
source .env/bin/activate
55
python -m pip install --upgrade pip
66

7+
cd workers
78
python -m pip install .
89
python -m pip install . --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"
910

eng/pack/scripts/nix_arm64_deps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ docker run --name my-arm64-container --platform linux/arm64 \
2121
ls -la /src # debug: see what files exist
2222
apt-get update && apt-get install -y git curl && \
2323
pip install --upgrade pip && \
24+
cd workers && \
2425
pip install . && \
2526
pip install . --target /src && \
2627
pip install invoke && \
@@ -29,6 +30,8 @@ docker run --name my-arm64-container --platform linux/arm64 \
2930
ls -la /src
3031
"
3132

33+
cd workers
34+
3235
# This copies over the build files from the docker container to the local pipeline
3336
docker cp my-arm64-container:/src/. $BUILD_SOURCESDIRECTORY/all/
3437
docker rm my-arm64-container

eng/pack/scripts/nix_deps.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python -m venv .env
44
source .env/bin/activate
55
python -m pip install --upgrade pip
66

7+
cd workers
78
python -m pip install .
89
python -m pip install . --no-compile --target "$BUILD_SOURCESDIRECTORY/deps"
910

eng/pack/scripts/win_deps.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ python -m venv .env
88
.env\Scripts\Activate.ps1
99
python -m pip install --upgrade pip
1010

11+
cd workers
1112
python -m pip install .
1213

1314
$depsPath = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath "deps"

eng/pack/templates/macos_64_env_gen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ steps:
4242
displayName: 'Install Dependencies'
4343
- bash: |
4444
pip install pip-audit
45+
cd workers
4546
pip-audit -r requirements.txt
4647
displayName: 'Run vulnerability scan'
4748
condition: ne(variables['pythonVersion'], '3.7')

0 commit comments

Comments
 (0)