Skip to content

Commit 96c8fc9

Browse files
committed
Updated the python version patch query
1 parent 3c4bd3d commit 96c8fc9

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
# api-management-utils
22
Scripts and utilities used across API managment platform and services
33

4+
5+
################################################################################
6+
########### Python upgrade to 3.13 ###########
7+
########### Utils Repo has been updated to python 3.13 ###########
8+
################################################################################
9+
10+
########### We are continuing to support python 3.8/9(which are currently out of support) until January 26th 2026 ###########
11+
########### After the deadline your pipelines will fail if you are using python version 3.8/9 ###########
12+
13+
Python upgrade related changes
14+
###############################
15+
Projects using Python versions older than 3.13 and extending their pipeline with the utils repository must update their pipelines to ensure compatibility with the latest changes.
16+
For detailed guidance, please refer to the APIM FAQ page:
17+
https://nhsd-confluence.digital.nhs.uk/spaces/APM/pages/1226682275/Pipeline+Queries
18+
19+
Note: Projects running Python version 3.13 or later do not need any pipeline modifications.
20+
21+
22+
423
## Scripts
524
* `template.py` - cli for basic jinja templating
625
* `test_pull_request_deployments.py` - cli for testing utils against other repositories

azure/build-prereqs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ steps:
1010
# displayName: 'Set python tool cache path'
1111
- bash: |
1212
PATCH=$(curl -s https://api.github.com/repos/actions/python-versions/releases \
13-
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | sort | last' \
14-
| cut -d- -f1)
13+
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | .[]' \
14+
| sort -V | tail -n 1 | cut -d- -f1)
1515
echo "Resolved latest python version: $PATCH"
1616
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH;]/agent/_work/_tool/Python/${PATCH}/x64/lib/"
1717
displayName: 'Query and set python tool cache path'

azure/common/apigee-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ jobs:
150150

151151
- bash: |
152152
PATCH=$(curl -s https://api.github.com/repos/actions/python-versions/releases \
153-
| jq -r '[.[] | .tag_name | select(startswith("${{ parameters.python_version }}"))] | sort | last' \
154-
| cut -d- -f1)
153+
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | .[]' \
154+
| sort -V | tail -n 1 | cut -d- -f1)
155155
echo "Resolved latest python version: $PATCH"
156156
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH;]/agent/_work/_tool/Python/${PATCH}/x64/lib/"
157157
displayName: 'Query and set python tool cache path'

azure/common/deploy-stage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ stages:
126126

127127
- bash: |
128128
PATCH=$(curl -s https://api.github.com/repos/actions/python-versions/releases \
129-
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | sort | last' \
130-
| cut -d- -f1)
129+
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | .[]' \
130+
| sort -V | tail -n 1 | cut -d- -f1)
131131
echo "Resolved latest python version: $PATCH"
132132
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH;]/agent/_work/_tool/Python/${PATCH}/x64/lib/"
133133
displayName: 'Query and set python tool cache path'

azure/utils-pr-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636

3737
- bash: |
3838
PATCH=$(curl -s https://api.github.com/repos/actions/python-versions/releases \
39-
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | sort | last' \
40-
| cut -d- -f1)
39+
| jq -r '[.[] | .tag_name | select(startswith("3.13"))] | .[]' \
40+
| sort -V | tail -n 1 | cut -d- -f1)
4141
echo "Resolved latest python version: $PATCH"
4242
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH;]/agent/_work/_tool/Python/${PATCH}/x64/lib/"
4343
displayName: 'Query and set python tool cache path'

0 commit comments

Comments
 (0)