From 93b4ca9a589f29ca61e5f3bdd32d4148971eec9e Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 14:00:32 +1000 Subject: [PATCH 01/18] upgraded lxml and tested --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 96333700..1dea09aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ schematics~=2.1.1 pyyaml~=6.0.2 fuzzywuzzy~=0.18.0 pluralizer~=1.2.0 -lxml~=4.9.4 +lxml>=5.0.0 flask~=3.0.3 cachelib~=0.13.0 xmltodict~=0.13.0 From f2d0b0026697ff7dd4ceeaac098c89015c34ef6f Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:03:43 +1000 Subject: [PATCH 02/18] created compatibility matrix --- .github/workflows/python-compatibility.yml | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/python-compatibility.yml diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml new file mode 100644 index 00000000..cfad18f6 --- /dev/null +++ b/.github/workflows/python-compatibility.yml @@ -0,0 +1,142 @@ +name: Python Compatibility Check + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + +env: + # Change this to invalidate existing cache. + CACHE_PREFIX: v0 + PYTHON_PATH: ./ + +permissions: + contents: read + +jobs: + checks: + name: Python ${{ matrix.python }} - ${{ matrix.os }} - ${{ matrix.task.name }} + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + task: + - name: Build + run: | + set -x + pip list + pip install twine + # update setup related tools + pip install --upgrade setuptools wheel + pip list + python setup.py check + python setup.py bdist_wheel sdist + # check package metadata + twine check ./dist/* + +# - name: Test +# run: | +# pytest -v --color=yes tests/ + +# - name: Lint +# run: flake8 . + +# - name: Type check +# run: mypy . + +# - name: Style +# run: black --check . + +# - name: Docs +# run: cd docs && make html + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + + - name: Install prerequisites + run: | + pip install --upgrade pip setuptools wheel virtualenv + npm install -g pnpm@9.5.0 + pnpm install + + - name: Set build variables + shell: bash + run: | + # Get the exact Python version to use in the cache key. + echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV + echo "RUNNER_ARCH=$(uname -m)" >> $GITHUB_ENV + echo "NODE_VERSION=$(node --version)" >> $GITHUB_ENV + # Use week number in cache key so we can refresh the cache weekly. + echo "WEEK_NUMBER=$(date +%V)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + id: virtualenv-cache + with: + path: | + .venv + key: ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }} + + - name: Setup virtual environment (no cache hit) + if: steps.virtualenv-cache.outputs.cache-hit != 'true' + run: | + test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv + . .venv/bin/activate + pip install -e .[dev] + + - name: Install editable (cache hit) + if: steps.virtualenv-cache.outputs.cache-hit == 'true' + run: | + . .venv/bin/activate + pip install --no-deps -e .[dev] + + - name: Show environment info + run: | + . .venv/bin/activate + which python + python --version + pip freeze + which node + node --version + npm --version + pnpm --version + + - name: Build Web + run: | + pnpm build:typespec + pnpm build:web + pnpm bundle + env: + CI: false + - name: Test Typespec-aaz Emitter + run: | + pnpm test-aaz-emitter + + - name: ${{ matrix.task.name }} + run: | + . .venv/bin/activate + ${{ matrix.task.run }} + + - name: Clean up + if: always() + run: | + . .venv/bin/activate + pip uninstall -y my-package From 87235b5581aac078b1272cfacd775fdbfc9de5f1 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:08:20 +1000 Subject: [PATCH 03/18] forced compatibility matrix run in feature branch --- .github/workflows/python-compatibility.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index cfad18f6..8e8fce0d 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -6,6 +6,9 @@ concurrency: on: workflow_dispatch: + push: + branches: + - resilv/py313 env: # Change this to invalidate existing cache. From 91e0bc570ec06389c1b6d57f0b1f1359e3651460 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:17:05 +1000 Subject: [PATCH 04/18] updated windows version for longer file names --- .github/workflows/python-compatibility.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 8e8fce0d..a101c470 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -26,7 +26,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # os: [ubuntu-latest, macos-latest, windows-latest] # Original - temporarily testing Windows only + os: [windows-latest] python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] task: - name: Build @@ -61,7 +62,13 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'recursive' + submodules: ${{ runner.os != 'Windows' && 'recursive' || 'false' }} + + - name: Configure Git for long paths (Windows) + if: runner.os == 'Windows' + run: | + git config --system core.longpaths true + git submodule update --init --recursive - name: Setup Node.js uses: actions/setup-node@v3 From 6315b3f13caaf1608d994b400cd1b447f93ea295 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:25:10 +1000 Subject: [PATCH 05/18] adjusted virtual enviroment update for different oss --- .github/workflows/python-compatibility.yml | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index a101c470..2c61d4c9 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -109,18 +109,30 @@ jobs: if: steps.virtualenv-cache.outputs.cache-hit != 'true' run: | test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv - . .venv/bin/activate + if [ "${{ runner.os }}" == "Windows" ]; then + .venv\Scripts\Activate.ps1 + else + . .venv/bin/activate + fi pip install -e .[dev] - name: Install editable (cache hit) if: steps.virtualenv-cache.outputs.cache-hit == 'true' run: | - . .venv/bin/activate + if [ "${{ runner.os }}" == "Windows" ]; then + .venv\Scripts\Activate.ps1 + else + . .venv/bin/activate + fi pip install --no-deps -e .[dev] - name: Show environment info run: | - . .venv/bin/activate + if [ "${{ runner.os }}" == "Windows" ]; then + .venv\Scripts\Activate.ps1 + else + . .venv/bin/activate + fi which python python --version pip freeze @@ -142,11 +154,19 @@ jobs: - name: ${{ matrix.task.name }} run: | - . .venv/bin/activate + if [ "${{ runner.os }}" == "Windows" ]; then + .venv\Scripts\Activate.ps1 + else + . .venv/bin/activate + fi ${{ matrix.task.run }} - name: Clean up if: always() run: | - . .venv/bin/activate + if [ "${{ runner.os }}" == "Windows" ]; then + .venv\Scripts\Activate.ps1 + else + . .venv/bin/activate + fi pip uninstall -y my-package From 372d5828d9270493bf56b9947722e481828fb0f9 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:30:54 +1000 Subject: [PATCH 06/18] addressing further compatibility issues --- .github/workflows/python-compatibility.yml | 95 ++++++++++++++-------- 1 file changed, 62 insertions(+), 33 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 2c61d4c9..e6d91e34 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -105,34 +105,40 @@ jobs: restore-keys: | ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }} - - name: Setup virtual environment (no cache hit) - if: steps.virtualenv-cache.outputs.cache-hit != 'true' + - name: Setup virtual environment (no cache hit) - Unix/Linux/macOS + if: steps.virtualenv-cache.outputs.cache-hit != 'true' && runner.os != 'Windows' run: | test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv - if [ "${{ runner.os }}" == "Windows" ]; then - .venv\Scripts\Activate.ps1 - else - . .venv/bin/activate - fi + . .venv/bin/activate pip install -e .[dev] + shell: bash + + - name: Setup virtual environment (no cache hit) - Windows + if: steps.virtualenv-cache.outputs.cache-hit != 'true' && runner.os == 'Windows' + run: | + if (!(Test-Path .venv)) { python -m venv .venv } + .venv\Scripts\Activate.ps1 + pip install -e .[dev] + shell: pwsh - - name: Install editable (cache hit) - if: steps.virtualenv-cache.outputs.cache-hit == 'true' + - name: Install editable (cache hit) - Unix/Linux/macOS + if: steps.virtualenv-cache.outputs.cache-hit == 'true' && runner.os != 'Windows' run: | - if [ "${{ runner.os }}" == "Windows" ]; then - .venv\Scripts\Activate.ps1 - else - . .venv/bin/activate - fi + . .venv/bin/activate pip install --no-deps -e .[dev] + shell: bash - - name: Show environment info + - name: Install editable (cache hit) - Windows + if: steps.virtualenv-cache.outputs.cache-hit == 'true' && runner.os == 'Windows' run: | - if [ "${{ runner.os }}" == "Windows" ]; then - .venv\Scripts\Activate.ps1 - else - . .venv/bin/activate - fi + .venv\Scripts\Activate.ps1 + pip install --no-deps -e .[dev] + shell: pwsh + + - name: Show environment info - Unix/Linux/macOS + if: runner.os != 'Windows' + run: | + . .venv/bin/activate which python python --version pip freeze @@ -140,6 +146,20 @@ jobs: node --version npm --version pnpm --version + shell: bash + + - name: Show environment info - Windows + if: runner.os == 'Windows' + run: | + .venv\Scripts\Activate.ps1 + Get-Command python + python --version + pip freeze + Get-Command node + node --version + npm --version + pnpm --version + shell: pwsh - name: Build Web run: | @@ -152,21 +172,30 @@ jobs: run: | pnpm test-aaz-emitter - - name: ${{ matrix.task.name }} + - name: ${{ matrix.task.name }} - Unix/Linux/macOS + if: runner.os != 'Windows' run: | - if [ "${{ runner.os }}" == "Windows" ]; then - .venv\Scripts\Activate.ps1 - else - . .venv/bin/activate - fi + . .venv/bin/activate ${{ matrix.task.run }} + shell: bash + + - name: ${{ matrix.task.name }} - Windows + if: runner.os == 'Windows' + run: | + .venv\Scripts\Activate.ps1 + ${{ matrix.task.run }} + shell: pwsh + + - name: Clean up - Unix/Linux/macOS + if: always() && runner.os != 'Windows' + run: | + . .venv/bin/activate + pip uninstall -y my-package + shell: bash - - name: Clean up - if: always() + - name: Clean up - Windows + if: always() && runner.os == 'Windows' run: | - if [ "${{ runner.os }}" == "Windows" ]; then - .venv\Scripts\Activate.ps1 - else - . .venv/bin/activate - fi + .venv\Scripts\Activate.ps1 pip uninstall -y my-package + shell: pwsh From 9229d960cd2257b01d28011ddb4b5ebfee5547cb Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:43:39 +1000 Subject: [PATCH 07/18] simplified tests focusing on python packages only --- .github/workflows/python-compatibility.yml | 102 ++++++++++++--------- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index e6d91e34..baad6c3e 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -26,8 +26,7 @@ jobs: strategy: fail-fast: false matrix: - # os: [ubuntu-latest, macos-latest, windows-latest] # Original - temporarily testing Windows only - os: [windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] task: - name: Build @@ -61,19 +60,25 @@ jobs: steps: - uses: actions/checkout@v3 - with: - submodules: ${{ runner.os != 'Windows' && 'recursive' || 'false' }} + # Submodules contain TypeSpec/web code - not needed for Python package compatibility testing + # Uncomment the 'with' section below if you need to test TypeSpec integration or web components + # with: + # submodules: ${{ runner.os != 'Windows' && 'recursive' || 'false' }} - - name: Configure Git for long paths (Windows) - if: runner.os == 'Windows' - run: | - git config --system core.longpaths true - git submodule update --init --recursive - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' + # Git long paths configuration - only needed if submodules are used (TypeSpec has long file paths) + # Uncomment if you restore submodule checkout and encounter Windows path length issues + # - name: Configure Git for long paths (Windows) + # if: runner.os == 'Windows' + # run: | + # git config --system core.longpaths true + # git submodule update --init --recursive + + # Node.js setup - only needed for web builds and TypeSpec compilation + # Uncomment if you need to test web components or TypeSpec emitter functionality + # - name: Setup Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: '20.x' - name: Setup Python uses: actions/setup-python@v3 @@ -82,33 +87,37 @@ jobs: - name: Install prerequisites run: | - pip install --upgrade pip setuptools wheel virtualenv - npm install -g pnpm@9.5.0 - pnpm install + pip install --upgrade pip setuptools wheel + # Node.js/PNPM dependencies - only needed for web builds and TypeSpec compilation + # Uncomment the lines below if you need to test web components or TypeSpec functionality + # npm install -g pnpm@9.5.0 + # pnpm install - name: Set build variables shell: bash run: | # Get the exact Python version to use in the cache key. echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV - echo "RUNNER_ARCH=$(uname -m)" >> $GITHUB_ENV - echo "NODE_VERSION=$(node --version)" >> $GITHUB_ENV - # Use week number in cache key so we can refresh the cache weekly. - echo "WEEK_NUMBER=$(date +%V)" >> $GITHUB_ENV + # Architecture info - uncomment if you need platform-specific caching or debugging + # echo "RUNNER_ARCH=$(uname -m)" >> $GITHUB_ENV + # Node.js version - only needed for web/TypeSpec builds + # echo "NODE_VERSION=$(node --version)" >> $GITHUB_ENV + # Weekly cache refresh - uncomment if you want time-based cache invalidation + # echo "WEEK_NUMBER=$(date +%V)" >> $GITHUB_ENV - uses: actions/cache@v3 id: virtualenv-cache with: path: | .venv - key: ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }} + key: ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }} + ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }} - name: Setup virtual environment (no cache hit) - Unix/Linux/macOS if: steps.virtualenv-cache.outputs.cache-hit != 'true' && runner.os != 'Windows' run: | - test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv + python -m venv .venv . .venv/bin/activate pip install -e .[dev] shell: bash @@ -116,7 +125,7 @@ jobs: - name: Setup virtual environment (no cache hit) - Windows if: steps.virtualenv-cache.outputs.cache-hit != 'true' && runner.os == 'Windows' run: | - if (!(Test-Path .venv)) { python -m venv .venv } + python -m venv .venv .venv\Scripts\Activate.ps1 pip install -e .[dev] shell: pwsh @@ -142,10 +151,11 @@ jobs: which python python --version pip freeze - which node - node --version - npm --version - pnpm --version + # Node.js version info - uncomment if you need to verify Node.js/npm/pnpm versions + # which node + # node --version + # npm --version + # pnpm --version shell: bash - name: Show environment info - Windows @@ -155,22 +165,28 @@ jobs: Get-Command python python --version pip freeze - Get-Command node - node --version - npm --version - pnpm --version + # Node.js version info - uncomment if you need to verify Node.js/npm/pnpm versions + # Get-Command node + # node --version + # npm --version + # pnpm --version shell: pwsh - - name: Build Web - run: | - pnpm build:typespec - pnpm build:web - pnpm bundle - env: - CI: false - - name: Test Typespec-aaz Emitter - run: | - pnpm test-aaz-emitter + # Web build steps - tests TypeScript/web components compilation and bundling + # Uncomment if you need to verify that web components work with your Python package changes + # - name: Build Web + # run: | + # pnpm build:typespec + # pnpm build:web + # pnpm bundle + # env: + # CI: false + + # TypeSpec emitter testing - tests the TypeSpec-to-code generation functionality + # Uncomment if you need to verify TypeSpec emitter compatibility with your Python changes + # - name: Test Typespec-aaz Emitter + # run: | + # pnpm test-aaz-emitter - name: ${{ matrix.task.name }} - Unix/Linux/macOS if: runner.os != 'Windows' From e051f4e705a63d022a4f99a7bdd4a84a7d183022 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:56:53 +1000 Subject: [PATCH 08/18] removed package caches --- .github/workflows/python-compatibility.yml | 47 ++++++++-------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index baad6c3e..98ca6733 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -31,7 +31,6 @@ jobs: task: - name: Build run: | - set -x pip list pip install twine # update setup related tools @@ -105,45 +104,33 @@ jobs: # Weekly cache refresh - uncomment if you want time-based cache invalidation # echo "WEEK_NUMBER=$(date +%V)" >> $GITHUB_ENV - - uses: actions/cache@v3 - id: virtualenv-cache - with: - path: | - .venv - key: ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }} - - - name: Setup virtual environment (no cache hit) - Unix/Linux/macOS - if: steps.virtualenv-cache.outputs.cache-hit != 'true' && runner.os != 'Windows' + # Caching disabled for Python compatibility testing to ensure clean state every run + # Uncomment the section below if you want to enable caching for faster builds + # - uses: actions/cache@v3 + # id: virtualenv-cache + # with: + # path: | + # .venv + # key: ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }} + # restore-keys: | + # ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }} + + - name: Setup virtual environment - Unix/Linux/macOS + if: runner.os != 'Windows' run: | python -m venv .venv . .venv/bin/activate pip install -e .[dev] shell: bash - - name: Setup virtual environment (no cache hit) - Windows - if: steps.virtualenv-cache.outputs.cache-hit != 'true' && runner.os == 'Windows' + - name: Setup virtual environment - Windows + if: runner.os == 'Windows' run: | python -m venv .venv .venv\Scripts\Activate.ps1 pip install -e .[dev] shell: pwsh - - name: Install editable (cache hit) - Unix/Linux/macOS - if: steps.virtualenv-cache.outputs.cache-hit == 'true' && runner.os != 'Windows' - run: | - . .venv/bin/activate - pip install --no-deps -e .[dev] - shell: bash - - - name: Install editable (cache hit) - Windows - if: steps.virtualenv-cache.outputs.cache-hit == 'true' && runner.os == 'Windows' - run: | - .venv\Scripts\Activate.ps1 - pip install --no-deps -e .[dev] - shell: pwsh - - name: Show environment info - Unix/Linux/macOS if: runner.os != 'Windows' run: | @@ -206,12 +193,12 @@ jobs: if: always() && runner.os != 'Windows' run: | . .venv/bin/activate - pip uninstall -y my-package + pip uninstall -y aaz-dev || true shell: bash - name: Clean up - Windows if: always() && runner.os == 'Windows' run: | .venv\Scripts\Activate.ps1 - pip uninstall -y my-package + pip uninstall -y aaz-dev; if ($LASTEXITCODE -ne 0) { Write-Host "Package not found or already uninstalled" } shell: pwsh From 9117d9bc4c12faf448132ecf605181a5bb20ad00 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 17:59:38 +1000 Subject: [PATCH 09/18] pip ugrade was failing under windows --- .github/workflows/python-compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 98ca6733..2fe09763 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -86,7 +86,7 @@ jobs: - name: Install prerequisites run: | - pip install --upgrade pip setuptools wheel + python -m pip install --upgrade pip setuptools wheel # Node.js/PNPM dependencies - only needed for web builds and TypeSpec compilation # Uncomment the lines below if you need to test web components or TypeSpec functionality # npm install -g pnpm@9.5.0 From 181dd065c60114dd6796f1d0b93fccaaed27f689 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 18:16:16 +1000 Subject: [PATCH 10/18] updated code and documents for python compatibility 3.8 to 3.13 --- .github/workflows/python-compatibility.yml | 71 +++---------------- README.md | 2 +- docs/pages/usage/setup_and_run.md | 2 +- setup.py | 5 +- .../cli/templates/extension/setup.py.j2 | 5 +- .../output/az-firewall/setup.py | 5 +- .../output/new-extension/setup.py | 5 +- 7 files changed, 27 insertions(+), 68 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 2fe09763..9e8b5660 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -1,3 +1,12 @@ +# Python Compatibility Testing Workflow +# +# Tests Python package build compatibility across: +# - Operating Systems: Ubuntu, macOS, Windows +# - Python Versions: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 +# +# Validates that the package can be built and installed correctly +# on all supported platforms and Python versions. + name: Python Compatibility Check concurrency: @@ -6,9 +15,6 @@ concurrency: on: workflow_dispatch: - push: - branches: - - resilv/py313 env: # Change this to invalidate existing cache. @@ -33,51 +39,14 @@ jobs: run: | pip list pip install twine - # update setup related tools pip install --upgrade setuptools wheel pip list python setup.py check python setup.py bdist_wheel sdist - # check package metadata twine check ./dist/* -# - name: Test -# run: | -# pytest -v --color=yes tests/ - -# - name: Lint -# run: flake8 . - -# - name: Type check -# run: mypy . - -# - name: Style -# run: black --check . - -# - name: Docs -# run: cd docs && make html - steps: - uses: actions/checkout@v3 - # Submodules contain TypeSpec/web code - not needed for Python package compatibility testing - # Uncomment the 'with' section below if you need to test TypeSpec integration or web components - # with: - # submodules: ${{ runner.os != 'Windows' && 'recursive' || 'false' }} - - # Git long paths configuration - only needed if submodules are used (TypeSpec has long file paths) - # Uncomment if you restore submodule checkout and encounter Windows path length issues - # - name: Configure Git for long paths (Windows) - # if: runner.os == 'Windows' - # run: | - # git config --system core.longpaths true - # git submodule update --init --recursive - - # Node.js setup - only needed for web builds and TypeSpec compilation - # Uncomment if you need to test web components or TypeSpec emitter functionality - # - name: Setup Node.js - # uses: actions/setup-node@v3 - # with: - # node-version: '20.x' - name: Setup Python uses: actions/setup-python@v3 @@ -87,33 +56,11 @@ jobs: - name: Install prerequisites run: | python -m pip install --upgrade pip setuptools wheel - # Node.js/PNPM dependencies - only needed for web builds and TypeSpec compilation - # Uncomment the lines below if you need to test web components or TypeSpec functionality - # npm install -g pnpm@9.5.0 - # pnpm install - name: Set build variables shell: bash run: | - # Get the exact Python version to use in the cache key. echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV - # Architecture info - uncomment if you need platform-specific caching or debugging - # echo "RUNNER_ARCH=$(uname -m)" >> $GITHUB_ENV - # Node.js version - only needed for web/TypeSpec builds - # echo "NODE_VERSION=$(node --version)" >> $GITHUB_ENV - # Weekly cache refresh - uncomment if you want time-based cache invalidation - # echo "WEEK_NUMBER=$(date +%V)" >> $GITHUB_ENV - - # Caching disabled for Python compatibility testing to ensure clean state every run - # Uncomment the section below if you want to enable caching for faster builds - # - uses: actions/cache@v3 - # id: virtualenv-cache - # with: - # path: | - # .venv - # key: ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }} - # restore-keys: | - # ${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ env.PYTHON_VERSION }} - name: Setup virtual environment - Unix/Linux/macOS if: runner.os != 'Windows' diff --git a/README.md b/README.md index 31c83def..8556f1e1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ After clone you can add `upstream` for every repos in your local clone by using ### 2 Setup python #### 2.1 Install python -Please install python with version >= 3.8 and <= 3.12 in your local machine. +Please install python with version >= 3.8 and <= 3.13 in your local machine. - For windows: You can download and run full installer from [Python Download](https://www.python.org/downloads/). - For linux: You can install python from Package Manager or build a stable relase from source code diff --git a/docs/pages/usage/setup_and_run.md b/docs/pages/usage/setup_and_run.md index 457dc365..4d39e7d7 100644 --- a/docs/pages/usage/setup_and_run.md +++ b/docs/pages/usage/setup_and_run.md @@ -17,7 +17,7 @@ weight: 100 ### Install python -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: +This tool is compatible with python versions >=3.8 and <=3.13. You can use an existing python or install a new one by the following ways: - For Windows users: You can download and run full installer from [Python Download](https://www.python.org/downloads/). - For Linux users: You can install python from Package Manager or build a stable release from source code diff --git a/setup.py b/setup.py index 8a0135e5..d9042b03 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,10 @@ def fix_url_dependencies(req: str) -> str: "Natural Language :: English", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10" + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13" ], keywords="azure", url="https://github.com/Azure/aaz-dev-tools", diff --git a/src/aaz_dev/cli/templates/extension/setup.py.j2 b/src/aaz_dev/cli/templates/extension/setup.py.j2 index edd4dfe1..03424e70 100644 --- a/src/aaz_dev/cli/templates/extension/setup.py.j2 +++ b/src/aaz_dev/cli/templates/extension/setup.py.j2 @@ -17,9 +17,12 @@ CLASSIFIERS = [ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'License :: OSI Approved :: MIT License', ] diff --git a/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py b/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py index cefbda4e..def96f48 100644 --- a/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py +++ b/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py @@ -20,9 +20,12 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'License :: OSI Approved :: MIT License', ] diff --git a/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py b/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py index 7962c972..00e070fd 100644 --- a/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py +++ b/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py @@ -20,9 +20,12 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'License :: OSI Approved :: MIT License', ] From 9e9e0e469a24ba350bc375301c148691c9b0e25a Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 5 Aug 2025 18:21:55 +1000 Subject: [PATCH 11/18] trigger build test --- .github/workflows/python-compatibility.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 9e8b5660..ac8aed8a 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -15,6 +15,9 @@ concurrency: on: workflow_dispatch: + push: + branches: + - resilv/py313 env: # Change this to invalidate existing cache. From 8ca9375cd5fa1576107c28c5c6c61d028738bccc Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Wed, 6 Aug 2025 11:34:50 +1000 Subject: [PATCH 12/18] addressed comments --- .github/workflows/python-compatibility.yml | 27 ++++++++++++++++--- README.md | 4 +-- docs/pages/usage/setup_and_run.md | 2 +- setup.py | 3 +-- .../cli/templates/extension/setup.py.j2 | 1 - .../output/az-firewall/setup.py | 1 - .../output/new-extension/setup.py | 1 - 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index ac8aed8a..f79def02 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -2,7 +2,7 @@ # # Tests Python package build compatibility across: # - Operating Systems: Ubuntu, macOS, Windows -# - Python Versions: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 +# - Python Versions: 3.9, 3.10, 3.11, 3.12, 3.13 # # Validates that the package can be built and installed correctly # on all supported platforms and Python versions. @@ -16,8 +16,7 @@ concurrency: on: workflow_dispatch: push: - branches: - - resilv/py313 + pull_request: env: # Change this to invalidate existing cache. @@ -36,7 +35,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] task: - name: Build run: | @@ -65,6 +64,26 @@ jobs: run: | echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV + - name: Test dependency wheels availability - Unix/Linux/macOS + if: runner.os != 'Windows' + run: | + python -m venv .venv-deps-test + . .venv-deps-test/bin/activate + pip install --only-binary=:all: -r requirements.txt + deactivate + rm -rf .venv-deps-test + shell: bash + + - name: Test dependency wheels availability - Windows + if: runner.os == 'Windows' + run: | + python -m venv .venv-deps-test + .venv-deps-test\Scripts\Activate.ps1 + pip install --only-binary=:all: -r requirements.txt + deactivate + Remove-Item -Recurse -Force .venv-deps-test + shell: pwsh + - name: Setup virtual environment - Unix/Linux/macOS if: runner.os != 'Windows' run: | diff --git a/README.md b/README.md index 8556f1e1..4fafdc60 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,12 @@ After clone you can add `upstream` for every repos in your local clone by using ### 2 Setup python #### 2.1 Install python -Please install python with version >= 3.8 and <= 3.13 in your local machine. +Please install python with version >= 3.9 and <= 3.13 in your local machine. - For windows: You can download and run full installer from [Python Download](https://www.python.org/downloads/). - For linux: You can install python from Package Manager or build a stable relase from source code -Check the version of python, make use it's not less than 3.8. +Check the version of python, make use it's not less than 3.9. - For windows: You can run: ```PowerShell diff --git a/docs/pages/usage/setup_and_run.md b/docs/pages/usage/setup_and_run.md index 4d39e7d7..183f9e4b 100644 --- a/docs/pages/usage/setup_and_run.md +++ b/docs/pages/usage/setup_and_run.md @@ -17,7 +17,7 @@ weight: 100 ### Install python -This tool is compatible with python versions >=3.8 and <=3.13. You can use an existing python or install a new one by the following ways: +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: - For Windows users: You can download and run full installer from [Python Download](https://www.python.org/downloads/). - For Linux users: You can install python from Package Manager or build a stable release from source code diff --git a/setup.py b/setup.py index d9042b03..71adc6ca 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,6 @@ def fix_url_dependencies(req: str) -> str: "Environment :: Console", "License :: OSI Approved :: MIT License", "Natural Language :: English", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -71,7 +70,7 @@ def fix_url_dependencies(req: str) -> str: ), include_package_data=True, install_requires=read_requirements("requirements.txt"), - python_requires=">=3.8", + python_requires=">=3.9", entry_points={ "console_scripts": ["aaz-dev=aaz_dev.app.main:main"] }, diff --git a/src/aaz_dev/cli/templates/extension/setup.py.j2 b/src/aaz_dev/cli/templates/extension/setup.py.j2 index 03424e70..4354216c 100644 --- a/src/aaz_dev/cli/templates/extension/setup.py.j2 +++ b/src/aaz_dev/cli/templates/extension/setup.py.j2 @@ -17,7 +17,6 @@ CLASSIFIERS = [ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', diff --git a/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py b/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py index def96f48..b8765f82 100644 --- a/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py +++ b/src/aaz_dev/cli/tests/extension_tests/output/az-firewall/setup.py @@ -20,7 +20,6 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', diff --git a/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py b/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py index 00e070fd..2b3ba11a 100644 --- a/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py +++ b/src/aaz_dev/cli/tests/extension_tests/output/new-extension/setup.py @@ -20,7 +20,6 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', From 2e41fbd7f848cab147c66dd1362c851df05a93eb Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Thu, 7 Aug 2025 05:46:51 +0000 Subject: [PATCH 13/18] updated requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1dea09aa..42054e8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ cachelib~=0.13.0 xmltodict~=0.13.0 packaging>=21.3 Jinja2~=3.1.4 -MarkupSafe~=2.1.5 +MarkupSafe>=2.1.5 jsonschema~=4.23.0 click~=8.1.2 setuptools==70.0.0 From abe8e503630f70c17239fde23029862a112cc971 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Wed, 13 Aug 2025 04:43:17 +0000 Subject: [PATCH 14/18] updated wrapt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 42054e8f..143f8ecf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,5 @@ click~=8.1.2 setuptools==70.0.0 python-Levenshtein azure-mgmt-core +wrapt>=1.11 azdev From 16a5a531efb3e7a8da98279357fe7ed951f05655 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Thu, 14 Aug 2025 02:50:43 +0000 Subject: [PATCH 15/18] update wrapt versions --- .github/workflows/python-compatibility.yml | 13 ++++++++++++- requirements.txt | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index f79def02..61ea43d5 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -69,7 +69,12 @@ jobs: run: | python -m venv .venv-deps-test . .venv-deps-test/bin/activate - pip install --only-binary=:all: -r requirements.txt + # Try installing with wheel-only first to catch dependency conflicts early + pip install --only-binary=:all: -r requirements.txt || { + echo "Warning: Some dependencies may not have wheels available" + echo "Attempting installation with source packages allowed..." + pip install -r requirements.txt + } deactivate rm -rf .venv-deps-test shell: bash @@ -79,7 +84,13 @@ jobs: run: | python -m venv .venv-deps-test .venv-deps-test\Scripts\Activate.ps1 + # Try installing with wheel-only first to catch dependency conflicts early pip install --only-binary=:all: -r requirements.txt + if ($LASTEXITCODE -ne 0) { + Write-Host "Warning: Some dependencies may not have wheels available" + Write-Host "Attempting installation with source packages allowed..." + pip install -r requirements.txt + } deactivate Remove-Item -Recurse -Force .venv-deps-test shell: pwsh diff --git a/requirements.txt b/requirements.txt index 143f8ecf..c9bb44a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,5 @@ click~=8.1.2 setuptools==70.0.0 python-Levenshtein azure-mgmt-core -wrapt>=1.11 +wrapt>=1.11,<1.14 azdev From 82a0b48c80980df2e38d4b5fb4f860d7e165d64c Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Thu, 14 Aug 2025 03:00:35 +0000 Subject: [PATCH 16/18] pinned azdev version --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c9bb44a3..ff1384b6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,5 @@ click~=8.1.2 setuptools==70.0.0 python-Levenshtein azure-mgmt-core -wrapt>=1.11,<1.14 -azdev +wrapt>=1.14 +azdev==0.2.5 From 18759ec1aa9d4c35922678c3e341b67ab4910f05 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Fri, 15 Aug 2025 03:12:44 +0000 Subject: [PATCH 17/18] test addressing requirements --- .github/workflows/python-compatibility.yml | 24 +++++++++++----------- requirements.txt | 5 +++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 61ea43d5..1edecddc 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -169,16 +169,16 @@ jobs: ${{ matrix.task.run }} shell: pwsh - - name: Clean up - Unix/Linux/macOS - if: always() && runner.os != 'Windows' - run: | - . .venv/bin/activate - pip uninstall -y aaz-dev || true - shell: bash + # - name: Clean up - Unix/Linux/macOS + # if: always() && runner.os != 'Windows' + # run: | + # . .venv/bin/activate + # pip uninstall -y aaz-dev || true + # shell: bash - - name: Clean up - Windows - if: always() && runner.os == 'Windows' - run: | - .venv\Scripts\Activate.ps1 - pip uninstall -y aaz-dev; if ($LASTEXITCODE -ne 0) { Write-Host "Package not found or already uninstalled" } - shell: pwsh + # - name: Clean up - Windows + # if: always() && runner.os == 'Windows' + # run: | + # .venv\Scripts\Activate.ps1 + # pip uninstall -y aaz-dev; if ($LASTEXITCODE -ne 0) { Write-Host "Package not found or already uninstalled" } + # shell: pwsh diff --git a/requirements.txt b/requirements.txt index ff1384b6..7dc31a1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,6 @@ click~=8.1.2 setuptools==70.0.0 python-Levenshtein azure-mgmt-core -wrapt>=1.14 -azdev==0.2.5 +# wrapt>=1.14 +# azdev==0.2.5 +azdev From 6b7ba5d83cc07c0be88adea06e06526c0400ad04 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Fri, 15 Aug 2025 03:16:36 +0000 Subject: [PATCH 18/18] addressing PR comments --- .github/workflows/python-compatibility.yml | 13 ------------- requirements.txt | 2 -- 2 files changed, 15 deletions(-) diff --git a/.github/workflows/python-compatibility.yml b/.github/workflows/python-compatibility.yml index 1edecddc..a60f8f46 100644 --- a/.github/workflows/python-compatibility.yml +++ b/.github/workflows/python-compatibility.yml @@ -169,16 +169,3 @@ jobs: ${{ matrix.task.run }} shell: pwsh - # - name: Clean up - Unix/Linux/macOS - # if: always() && runner.os != 'Windows' - # run: | - # . .venv/bin/activate - # pip uninstall -y aaz-dev || true - # shell: bash - - # - name: Clean up - Windows - # if: always() && runner.os == 'Windows' - # run: | - # .venv\Scripts\Activate.ps1 - # pip uninstall -y aaz-dev; if ($LASTEXITCODE -ne 0) { Write-Host "Package not found or already uninstalled" } - # shell: pwsh diff --git a/requirements.txt b/requirements.txt index 7dc31a1d..42054e8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,4 @@ click~=8.1.2 setuptools==70.0.0 python-Levenshtein azure-mgmt-core -# wrapt>=1.14 -# azdev==0.2.5 azdev