Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is primarily to prevent from auto formatting of yaml files in github workflows on vscode


# All files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Python files
[*.py]
indent_style = space
indent_size = 4

# YAML files - maintain 2-space indentation
[*.{yaml,yml}]
indent_style = space
indent_size = 2

# JSON files
[*.json]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

# Toml files
[*.toml]
indent_style = space
indent_size = 2

# GitHub Actions workflows
[.github/workflows/*.{yaml,yml}]
indent_style = space
indent_size = 2
40 changes: 0 additions & 40 deletions .github/actions/setup-poetry/action.yaml

This file was deleted.

25 changes: 17 additions & 8 deletions .github/workflows/build-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Set up Poetry
uses: ./.github/actions/setup-poetry
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install dependencies
run: poetry install --no-interaction
run: uv sync --group cicd

- name: pytest + coverage
shell: bash
run: |
set -o pipefail
pipx install algokit
algokit localnet start
poetry run pytest -n auto --junitxml=pytest-junit.xml --cov-report=term-missing:skip-covered --cov=src | tee pytest-coverage.txt
algokit localnet stop
uv run algokit localnet start
uv run poe test-ci 2>&1 | tee pytest-coverage.txt
uv run algokit localnet stop

- name: pytest coverage comment - using Python 3.10 on ubuntu-latest
if: matrix.python == '3.10' && matrix.os == 'ubuntu-latest'
Expand All @@ -41,5 +42,13 @@ jobs:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest-junit.xml

- name: Upload test results and coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-python-${{ matrix.python }}
path: pytest-junit.xml
retention-days: 30

- name: Build Wheel
run: poetry build --format wheel
run: uv build
17 changes: 6 additions & 11 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,11 @@ jobs:
fetch-depth: 0
token: ${{ steps.app_token.outputs.token }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Set up Poetry
uses: ./.github/actions/setup-poetry
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: poetry install --no-interaction --no-root
run: uv sync

- name: Get branch name
shell: bash
Expand All @@ -76,13 +71,13 @@ jobs:
- name: Create Continuous Deployment - Beta (non-prod)
if: steps.get_branch.outputs.branch == 'main' && !inputs.production_release
run: |
poetry run semantic-release \
uv run semantic-release \
-v DEBUG \
--prerelease \
--define=branch=main \
--define=upload_to_repository=true \
publish
gh release edit --prerelease "v$(poetry run semantic-release print-version --current)"
gh release edit --prerelease "v$(uv run semantic-release print-version --current)"
env:
GH_TOKEN: ${{ steps.app_token.outputs.token }}
REPOSITORY_USERNAME: __token__
Expand All @@ -91,7 +86,7 @@ jobs:
- name: Create Continuous Deployment - Production
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release
run: |
poetry run semantic-release \
uv run semantic-release \
-v DEBUG \
--define=version_source="commit" \
--define=patch_without_tag=true \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
with:
python-version: "3.12"

- name: Set up Poetry
uses: ./.github/actions/setup-poetry
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: poetry install --no-interaction --no-root
run: uv sync

- name: Check docstrings are up to date
run: poetry run poe docstrings-check
run: uv run poe docstrings-check

- name: Check docs are up to date
run: |
poetry run poe docs-md-only
uv run poe docs-md-only
git diff --exit-code ':!docs/markdown/autoapi/index.md' ':!docs/markdown/autoapi/algokit_utils/applications/app_factory/index.md' docs
25 changes: 7 additions & 18 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,23 @@ jobs:
with:
python-version: "3.10"

- name: Set up Poetry
uses: ./.github/actions/setup-poetry
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: poetry install --no-interaction --no-root
run: uv sync

- name: Audit with pip-audit
run: |
# GHSA-4xh5-x5gv-qwph is safe to ignore since we are using a python version that is not affected
# can remove once pip has fix
# audit non dev dependencies, no exclusions
poetry export --without=dev > requirements.txt && poetry run pip-audit -r requirements.txt --ignore-vuln GHSA-4xh5-x5gv-qwph
# audit all dependencies, with exclusions.
# Audit all installed 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 --ignore-vuln GHSA-4xh5-x5gv-qwph
uv run pip-audit --ignore-vuln GHSA-4xh5-x5gv-qwph
- name: Check formatting with Ruff
- name: Check codebase with ruff and mypy
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
uv run poe lint
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,7 @@ cython_debug/

# Received approval test files
*.received.*

.references/

*.xml
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
- id: ruff-format
name: ruff-format
description: "Run 'ruff format' for extremely fast Python formatting"
entry: poetry run ruff format
entry: uv run ruff format
language: system
types: [python]
args: []
Expand All @@ -15,7 +15,7 @@ repos:
- id: ruff
name: ruff
description: "Run 'ruff' for extremely fast Python linting"
entry: poetry run ruff check
entry: uv run ruff check
language: system
"types": [python]
args: [--fix]
Expand All @@ -27,7 +27,7 @@ repos:
- id: mypy
name: mypy
description: "`mypy` will check Python types for correctness"
entry: poetry run mypy
entry: uv run mypy
language: system
types_or: [python, pyi]
require_serial: true
Expand All @@ -38,7 +38,7 @@ repos:
- id: docstrings-check
name: docstrings-check
description: "Check docstrings for correctness"
entry: poetry run poe docstrings-check
entry: uv run poe docstrings-check
language: system
types: [python]
files: "^(src)/"
16 changes: 2 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,11 @@
// Python
"platformSettings.autoLoad": true,
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
"python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.analysis.exclude": [
"tests/artifacts/**"
],
"python.analysis.typeCheckingMode": "basic",
"ruff.enable": true,
"ruff.lint.run": "onSave",
"ruff.lint.args": [
"--config=pyproject.toml"
],
"ruff.configuration": "pyproject.toml",
"ruff.importStrategy": "fromEnvironment",
"ruff.fixAll": true, //lint and fix all files in workspace
"ruff.organizeImports": true, //organize imports on save
Expand All @@ -57,7 +47,5 @@
}
]
},
"python.testing.pytestArgs": [
"."
],
"python.testing.pytestArgs": ["tests"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Module Contents

### *class* algokit_utils.applications.enums.OnSchemaBreak(\*args, \*\*kwds)
### *class* algokit_utils.applications.enums.OnSchemaBreak

Bases: `enum.Enum`

Expand All @@ -27,7 +27,7 @@ Create a new Application and delete the old Application in a single transaction

Create a new Application

### *class* algokit_utils.applications.enums.OnUpdate(\*args, \*\*kwds)
### *class* algokit_utils.applications.enums.OnUpdate

Bases: `enum.Enum`

Expand All @@ -49,7 +49,7 @@ Create a new Application and delete the old Application in a single transaction

Create a new application

### *class* algokit_utils.applications.enums.OperationPerformed(\*args, \*\*kwds)
### *class* algokit_utils.applications.enums.OperationPerformed

Bases: `enum.Enum`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ class Proto(Protocol):
```

Such classes are primarily used with static type checkers that recognize
structural subtyping (static duck-typing).

For example:
structural subtyping (static duck-typing), for example:

```default
class C:
Expand All @@ -44,7 +42,7 @@ only the presence of given attributes, ignoring their type signatures.
Protocol classes can be generic, they are defined as:

```default
class GenProto[T](Protocol):
class GenProto(Protocol[T]):
def meth(self) -> T:
...
```
Expand All @@ -68,9 +66,7 @@ class Proto(Protocol):
```

Such classes are primarily used with static type checkers that recognize
structural subtyping (static duck-typing).

For example:
structural subtyping (static duck-typing), for example:

```default
class C:
Expand All @@ -89,7 +85,7 @@ only the presence of given attributes, ignoring their type signatures.
Protocol classes can be generic, they are defined as:

```default
class GenProto[T](Protocol):
class GenProto(Protocol[T]):
def meth(self) -> T:
...
```
Expand Down
Loading
Loading