-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: v2 - leveraging new AlgoKit interfaces and support for algokit-…
…utils-py v3 (#33) BREAKING CHANGE: Generator overhaul with ARC-56 support and TypeScript alignment - Complete generator rewrite using new core interfaces: - Split `generator.py` into specialized generators for `Arc56Contract`, `AppClient`, and `AppFactory` - Added struct handling and default argument support from type hints - Aligned generator output with TypeScript implementation: - Consistent ARC-32 spec formatting (single-line JSON) - Matching transaction field handling and nested struct resolution - Removed deprecated `AlgorandClientProtocol` - Added support for app call inner transaction fee coverage - Updated CI to test Python 3.10, 3.11, and 3.12 > Migration Required: Client generation now uses new ARC-56 based interfaces. Update generator calls to use new specialized generators and consult migration guide for struct handling changes. Requires algokit-utils v3
- Loading branch information
1 parent
49a1136
commit de55aae
Showing
78 changed files
with
88,665 additions
and
6,893 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
name: Continuous Delivery of Python package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
production_release: | ||
description: "Production release?" | ||
type: boolean | ||
required: true | ||
default: true | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
production_release: | ||
description: "Production release?" | ||
type: boolean | ||
required: true | ||
default: true | ||
|
||
concurrency: release | ||
|
||
permissions: | ||
contents: write | ||
packages: read | ||
contents: write | ||
packages: read | ||
|
||
jobs: | ||
ci-check-python: | ||
name: Check Python | ||
uses: ./.github/workflows/check-python.yaml | ||
ci-check-python: | ||
name: Check Python | ||
uses: ./.github/workflows/check-python.yaml | ||
|
||
ci-build-python: | ||
name: Build Python | ||
uses: ./.github/workflows/build-python.yaml | ||
needs: ci-check-python | ||
ci-build-python: | ||
name: Build Python | ||
uses: ./.github/workflows/build-python.yaml | ||
needs: ci-check-python | ||
|
||
release: | ||
name: Release Library | ||
needs: ci-build-python | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
contents: write | ||
packages: read | ||
release: | ||
name: Release Library | ||
needs: ci-build-python | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
contents: write | ||
packages: read | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Fetch entire repository history so we can determine version number from it | ||
fetch-depth: 0 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Fetch entire repository history so we can determine version number from it | ||
fetch-depth: 0 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "poetry" | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "poetry" | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Get branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | ||
id: get_branch | ||
- name: Get branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | ||
id: get_branch | ||
|
||
- name: Set Git user as GitHub actions | ||
run: git config --global user.email "[email protected]" && git config --global user.name "github-actions" | ||
- name: Set Git user as GitHub actions | ||
run: git config --global user.email "[email protected]" && git config --global user.name "github-actions" | ||
|
||
- name: Create Continuous Deployment - Beta (non-prod) | ||
if: steps.get_branch.outputs.branch == 'main' && !inputs.production_release | ||
run: | | ||
poetry run semantic-release \ | ||
-v DEBUG \ | ||
--prerelease \ | ||
--define=branch=main \ | ||
publish | ||
gh release edit --prerelease "v$(poetry run semantic-release print-version --current)" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Continuous Deployment - Beta (non-prod) | ||
if: steps.get_branch.outputs.branch == 'main' && !inputs.production_release | ||
run: | | ||
poetry run semantic-release \ | ||
-v DEBUG \ | ||
--prerelease \ | ||
--define=branch=main \ | ||
publish | ||
gh release edit --prerelease "v$(poetry run semantic-release print-version --current)" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Continuous Deployment - Production | ||
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release | ||
run: | | ||
poetry run semantic-release \ | ||
-v DEBUG \ | ||
--define=version_source="commit" \ | ||
--define=patch_without_tag=true \ | ||
--define=branch=main \ | ||
publish | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Continuous Deployment - Production | ||
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release | ||
run: | | ||
poetry run semantic-release \ | ||
-v DEBUG \ | ||
--define=version_source="commit" \ | ||
--define=patch_without_tag=true \ | ||
--define=branch=main \ | ||
publish | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,63 @@ | ||
name: Check Python Code | ||
|
||
on: | ||
workflow_call: | ||
workflow_call: | ||
|
||
jobs: | ||
check-python: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install pipx | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pipx | ||
python -m pipx ensurepath | ||
- name: Cache Poetry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.local/share/pipx/venvs/poetry | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-poetry- | ||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Audit with pip-audit | ||
run: | | ||
# audit non dev dependencies, no exclusions | ||
poetry export --without=dev > requirements.txt && poetry run pip-audit -r requirements.txt | ||
# audit all dependencies, with exclusions. | ||
# If a vulnerability is found in a dev dependency without an available fix, | ||
# it can be temporarily ignored by adding --ignore-vuln e.g. | ||
# --ignore-vuln "GHSA-hcpj-qp55-gfph" # GitPython vulnerability, dev only dependency | ||
poetry run pip-audit | ||
- name: Check formatting with Ruff | ||
run: | | ||
# stop the build if there are files that don't meet formatting requirements | ||
poetry run ruff format --check . | ||
- name: Check linting with Ruff | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
poetry run ruff . | ||
- name: Check types with mypy | ||
run: poetry run mypy | ||
check-python: | ||
runs-on: "ubuntu-latest" | ||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install pipx | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pipx | ||
python -m pipx ensurepath | ||
- name: Cache Poetry | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local/share/pipx/venvs/poetry | ||
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-poetry-${{ matrix.python-version }}- | ||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Audit with pip-audit | ||
run: | | ||
# audit non dev dependencies, no exclusions | ||
poetry export --without=dev > requirements.txt && poetry run pip-audit -r requirements.txt | ||
# audit all dependencies, with exclusions. | ||
# If a vulnerability is found in a dev dependency without an available fix, | ||
# it can be temporarily ignored by adding --ignore-vuln e.g. | ||
# --ignore-vuln "GHSA-hcpj-qp55-gfph" # GitPython vulnerability, dev only dependency | ||
poetry run pip-audit | ||
- name: Check formatting with Ruff | ||
run: | | ||
# stop the build if there are files that don't meet formatting requirements | ||
poetry run ruff format --check . | ||
- name: Check linting with Ruff | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
poetry run ruff check . | ||
- name: Check types with mypy | ||
run: poetry run mypy |
Oops, something went wrong.
de55aae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report