Skip to content

Commit 4358998

Browse files
authored
Merge pull request Azure#495 from RenSilvaAU/resilv/py313
Support Python 3.13
2 parents 23924b4 + 6b7ba5d commit 4358998

File tree

8 files changed

+193
-14
lines changed

8 files changed

+193
-14
lines changed
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# Python Compatibility Testing Workflow
2+
#
3+
# Tests Python package build compatibility across:
4+
# - Operating Systems: Ubuntu, macOS, Windows
5+
# - Python Versions: 3.9, 3.10, 3.11, 3.12, 3.13
6+
#
7+
# Validates that the package can be built and installed correctly
8+
# on all supported platforms and Python versions.
9+
10+
name: Python Compatibility Check
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
on:
17+
workflow_dispatch:
18+
push:
19+
pull_request:
20+
21+
env:
22+
# Change this to invalidate existing cache.
23+
CACHE_PREFIX: v0
24+
PYTHON_PATH: ./
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
checks:
31+
name: Python ${{ matrix.python }} - ${{ matrix.os }} - ${{ matrix.task.name }}
32+
runs-on: ${{ matrix.os }}
33+
timeout-minutes: 30
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
os: [ubuntu-latest, macos-latest, windows-latest]
38+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
39+
task:
40+
- name: Build
41+
run: |
42+
pip list
43+
pip install twine
44+
pip install --upgrade setuptools wheel
45+
pip list
46+
python setup.py check
47+
python setup.py bdist_wheel sdist
48+
twine check ./dist/*
49+
50+
steps:
51+
- uses: actions/checkout@v3
52+
53+
- name: Setup Python
54+
uses: actions/setup-python@v3
55+
with:
56+
python-version: ${{ matrix.python }}
57+
58+
- name: Install prerequisites
59+
run: |
60+
python -m pip install --upgrade pip setuptools wheel
61+
62+
- name: Set build variables
63+
shell: bash
64+
run: |
65+
echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV
66+
67+
- name: Test dependency wheels availability - Unix/Linux/macOS
68+
if: runner.os != 'Windows'
69+
run: |
70+
python -m venv .venv-deps-test
71+
. .venv-deps-test/bin/activate
72+
# Try installing with wheel-only first to catch dependency conflicts early
73+
pip install --only-binary=:all: -r requirements.txt || {
74+
echo "Warning: Some dependencies may not have wheels available"
75+
echo "Attempting installation with source packages allowed..."
76+
pip install -r requirements.txt
77+
}
78+
deactivate
79+
rm -rf .venv-deps-test
80+
shell: bash
81+
82+
- name: Test dependency wheels availability - Windows
83+
if: runner.os == 'Windows'
84+
run: |
85+
python -m venv .venv-deps-test
86+
.venv-deps-test\Scripts\Activate.ps1
87+
# Try installing with wheel-only first to catch dependency conflicts early
88+
pip install --only-binary=:all: -r requirements.txt
89+
if ($LASTEXITCODE -ne 0) {
90+
Write-Host "Warning: Some dependencies may not have wheels available"
91+
Write-Host "Attempting installation with source packages allowed..."
92+
pip install -r requirements.txt
93+
}
94+
deactivate
95+
Remove-Item -Recurse -Force .venv-deps-test
96+
shell: pwsh
97+
98+
- name: Setup virtual environment - Unix/Linux/macOS
99+
if: runner.os != 'Windows'
100+
run: |
101+
python -m venv .venv
102+
. .venv/bin/activate
103+
pip install -e .[dev]
104+
shell: bash
105+
106+
- name: Setup virtual environment - Windows
107+
if: runner.os == 'Windows'
108+
run: |
109+
python -m venv .venv
110+
.venv\Scripts\Activate.ps1
111+
pip install -e .[dev]
112+
shell: pwsh
113+
114+
- name: Show environment info - Unix/Linux/macOS
115+
if: runner.os != 'Windows'
116+
run: |
117+
. .venv/bin/activate
118+
which python
119+
python --version
120+
pip freeze
121+
# Node.js version info - uncomment if you need to verify Node.js/npm/pnpm versions
122+
# which node
123+
# node --version
124+
# npm --version
125+
# pnpm --version
126+
shell: bash
127+
128+
- name: Show environment info - Windows
129+
if: runner.os == 'Windows'
130+
run: |
131+
.venv\Scripts\Activate.ps1
132+
Get-Command python
133+
python --version
134+
pip freeze
135+
# Node.js version info - uncomment if you need to verify Node.js/npm/pnpm versions
136+
# Get-Command node
137+
# node --version
138+
# npm --version
139+
# pnpm --version
140+
shell: pwsh
141+
142+
# Web build steps - tests TypeScript/web components compilation and bundling
143+
# Uncomment if you need to verify that web components work with your Python package changes
144+
# - name: Build Web
145+
# run: |
146+
# pnpm build:typespec
147+
# pnpm build:web
148+
# pnpm bundle
149+
# env:
150+
# CI: false
151+
152+
# TypeSpec emitter testing - tests the TypeSpec-to-code generation functionality
153+
# Uncomment if you need to verify TypeSpec emitter compatibility with your Python changes
154+
# - name: Test Typespec-aaz Emitter
155+
# run: |
156+
# pnpm test-aaz-emitter
157+
158+
- name: ${{ matrix.task.name }} - Unix/Linux/macOS
159+
if: runner.os != 'Windows'
160+
run: |
161+
. .venv/bin/activate
162+
${{ matrix.task.run }}
163+
shell: bash
164+
165+
- name: ${{ matrix.task.name }} - Windows
166+
if: runner.os == 'Windows'
167+
run: |
168+
.venv\Scripts\Activate.ps1
169+
${{ matrix.task.run }}
170+
shell: pwsh
171+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ After clone you can add `upstream` for every repos in your local clone by using
2121
### 2 Setup python
2222

2323
#### 2.1 Install python
24-
Please install python with version >= 3.8 and <= 3.12 in your local machine.
24+
Please install python with version >= 3.9 and <= 3.13 in your local machine.
2525

2626
- For windows: You can download and run full installer from [Python Download](https://www.python.org/downloads/).
2727
- For linux: You can install python from Package Manager or build a stable relase from source code
2828

29-
Check the version of python, make use it's not less than 3.8.
29+
Check the version of python, make use it's not less than 3.9.
3030
- For windows:
3131
You can run:
3232
```PowerShell

docs/pages/usage/setup_and_run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ weight: 100
1717

1818
### Install python
1919

20-
This tool is compatible with python versions >=3.8 and <=3.12. You can use an existing python or install a new one by the following ways:
20+
This tool is compatible with python versions >=3.9 and <=3.13. You can use an existing python or install a new one by the following ways:
2121

2222
- For Windows users: You can download and run full installer from [Python Download](https://www.python.org/downloads/).
2323
- For Linux users: You can install python from Package Manager or build a stable release from source code

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ schematics~=2.1.1
22
pyyaml~=6.0.2
33
fuzzywuzzy~=0.18.0
44
pluralizer~=1.2.0
5-
lxml~=4.9.4
5+
lxml>=5.0.0
66
flask~=3.0.3
77
cachelib~=0.13.0
88
xmltodict~=0.13.0
99
packaging>=21.3
1010
Jinja2~=3.1.4
11-
MarkupSafe~=2.1.5
11+
MarkupSafe>=2.1.5
1212
jsonschema~=4.23.0
1313
click~=8.1.2
1414
setuptools==70.0.0

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ def fix_url_dependencies(req: str) -> str:
5050
"Environment :: Console",
5151
"License :: OSI Approved :: MIT License",
5252
"Natural Language :: English",
53-
"Programming Language :: Python :: 3.8",
5453
"Programming Language :: Python :: 3.9",
55-
"Programming Language :: Python :: 3.10"
54+
"Programming Language :: Python :: 3.10",
55+
"Programming Language :: Python :: 3.11",
56+
"Programming Language :: Python :: 3.12",
57+
"Programming Language :: Python :: 3.13"
5658
],
5759
keywords="azure",
5860
url="https://github.com/Azure/aaz-dev-tools",
@@ -68,7 +70,7 @@ def fix_url_dependencies(req: str) -> str:
6870
),
6971
include_package_data=True,
7072
install_requires=read_requirements("requirements.txt"),
71-
python_requires=">=3.8",
73+
python_requires=">=3.9",
7274
entry_points={
7375
"console_scripts": ["aaz-dev=aaz_dev.app.main:main"]
7476
},

src/aaz_dev/cli/templates/extension/setup.py.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ CLASSIFIERS = [
1717
'Intended Audience :: System Administrators',
1818
'Programming Language :: Python',
1919
'Programming Language :: Python :: 3',
20-
'Programming Language :: Python :: 3.7',
21-
'Programming Language :: Python :: 3.8',
2220
'Programming Language :: Python :: 3.9',
21+
'Programming Language :: Python :: 3.10',
22+
'Programming Language :: Python :: 3.11',
23+
'Programming Language :: Python :: 3.12',
24+
'Programming Language :: Python :: 3.13',
2325
'License :: OSI Approved :: MIT License',
2426
]
2527

src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
'Intended Audience :: System Administrators',
2121
'Programming Language :: Python',
2222
'Programming Language :: Python :: 3',
23-
'Programming Language :: Python :: 3.7',
24-
'Programming Language :: Python :: 3.8',
2523
'Programming Language :: Python :: 3.9',
24+
'Programming Language :: Python :: 3.10',
25+
'Programming Language :: Python :: 3.11',
26+
'Programming Language :: Python :: 3.12',
27+
'Programming Language :: Python :: 3.13',
2628
'License :: OSI Approved :: MIT License',
2729
]
2830

src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
'Intended Audience :: System Administrators',
2121
'Programming Language :: Python',
2222
'Programming Language :: Python :: 3',
23-
'Programming Language :: Python :: 3.7',
24-
'Programming Language :: Python :: 3.8',
2523
'Programming Language :: Python :: 3.9',
24+
'Programming Language :: Python :: 3.10',
25+
'Programming Language :: Python :: 3.11',
26+
'Programming Language :: Python :: 3.12',
27+
'Programming Language :: Python :: 3.13',
2628
'License :: OSI Approved :: MIT License',
2729
]
2830

0 commit comments

Comments
 (0)