Skip to content

Commit 428dab1

Browse files
authored
feat: algokit-utils-py v3 implementation (#119)
BREAKING CHANGE: Major restructuring and new app client interfaces - Moved all legacy v2 code to `legacy_v2/` folder and tests to `legacy_v2_tests/` - Introduced new core interfaces: - `TransactionComposer` for transaction building - `AppManager` for TEAL compilation and state management - `AppClient`, `AppFactory`, and `AppDeployer` for application lifecycle - `AssetManager` for asset operations - Added ABI value support and ARC-32 contract handling - Revamped documentation with migration guide and new capability docs - Added deprecation warnings for legacy interfaces > Migration Required: Existing users should consult the new migration guide and update imports from legacy paths to new interfaces. Check updated documentation for client usage patterns.
1 parent 753cf83 commit 428dab1

File tree

289 files changed

+37941
-8092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+37941
-8092
lines changed

.github/workflows/check-python.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ jobs:
4545
- name: Check types with mypy
4646
run: poetry run mypy
4747

48-
- name: Check docs are up to date
49-
run: |
50-
poetry run poe docs
51-
git diff --quiet --exit-code \
52-
':!docs/html/_sources/apidocs/algokit_utils/algokit_utils.md.txt' \
53-
':!docs/html/apidocs/algokit_utils/algokit_utils.html' \
54-
':!docs/html/searchindex.js' \
55-
':!docs/markdown/apidocs/algokit_utils/algokit_utils.md' \
56-
docs/
48+
# TODO: Restore before prod release of v3
49+
# - name: Check docs are up to date
50+
# run: |
51+
# poetry run poe docs-md-only
52+
# git diff --exit-code ':!docs/markdown/autoapi/index.md' ':!docs/markdown/autoapi/algokit_utils/applications/app_factory/index.md' docs

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,6 @@ cython_debug/
170170
/docs/source/apidocs
171171

172172
!docs/html
173+
174+
# Received approval test files
175+
*.received.*

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ repos:
2323
additional_dependencies: []
2424
minimum_pre_commit_version: "0"
2525
files: "^(src|tests)/"
26+
exclude: "^tests/artifacts/"
2627
- id: mypy
2728
name: mypy
2829
description: "`mypy` will check Python types for correctness"
@@ -33,3 +34,11 @@ repos:
3334
additional_dependencies: []
3435
minimum_pre_commit_version: "2.9.2"
3536
files: "^(src|tests)/"
37+
exclude: "^tests/artifacts/"
38+
- id: docstrings-check
39+
name: docstrings-check
40+
description: "Check docstrings for correctness"
41+
entry: poetry run poe docstrings-check
42+
language: system
43+
types: [python]
44+
files: "^(src)/"

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Python Debugger: Current File",
6+
"type": "debugpy",
7+
"request": "launch",
8+
"program": "${file}",
9+
"console": "integratedTerminal"
10+
},
11+
{
12+
"name": "Python: Debug Tests",
13+
"type": "debugpy",
14+
"request": "launch",
15+
"program": "${file}",
16+
"purpose": [
17+
"debug-test"
18+
],
19+
"console": "integratedTerminal",
20+
"justMyCode": false
21+
}
22+
]
23+
}

.vscode/settings.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,24 @@
1616
"**/__pycache__": true,
1717
".idea": true
1818
},
19-
2019
// Python
2120
"platformSettings.autoLoad": true,
2221
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
23-
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
22+
"python.analysis.extraPaths": [
23+
"${workspaceFolder}/src"
24+
],
2425
"[python]": {
2526
"editor.defaultFormatter": "charliermarsh.ruff"
2627
},
28+
"python.analysis.exclude": [
29+
"tests/artifacts/**"
30+
],
2731
"python.analysis.typeCheckingMode": "basic",
2832
"ruff.enable": true,
2933
"ruff.lint.run": "onSave",
30-
"ruff.lint.args": ["--config=pyproject.toml"],
34+
"ruff.lint.args": [
35+
"--config=pyproject.toml"
36+
],
3137
"ruff.importStrategy": "fromEnvironment",
3238
"ruff.fixAll": true, //lint and fix all files in workspace
3339
"ruff.organizeImports": true, //organize imports on save
@@ -37,7 +43,6 @@
3743
"ruff.codeAction.fixViolation": {
3844
"enable": true
3945
},
40-
4146
"mypy.configFile": "pyproject.toml",
4247
// set to empty array to use config from project
4348
"mypy.targets": [],
@@ -52,11 +57,7 @@
5257
}
5358
]
5459
},
55-
56-
// PowerShell
57-
"[powershell]": {
58-
"editor.defaultFormatter": "ms-vscode.powershell"
59-
},
60-
"powershell.codeFormatting.preset": "Stroustrup",
61-
"python.testing.pytestArgs": ["."]
60+
"python.testing.pytestArgs": [
61+
"."
62+
],
6263
}

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# AlgoKit Python Utilities
22

3-
A set of core Algorand utilities written in Python and released via PyPi that make it easier to build solutions on Algorand.
3+
A set of core Algorand utilities written in Python and released via PyPi that make it easier to build solutions on Algorand.
44
This project is part of [AlgoKit](https://github.com/algorandfoundation/algokit-cli).
55

6-
The goal of this library is to provide intuitive, productive utility functions that make it easier, quicker and safer to build applications on Algorand.
6+
The goal of this library is to provide intuitive, productive utility functions that make it easier, quicker and safer to build applications on Algorand.
77
Largely these functions wrap the underlying Algorand SDK, but provide a higher level interface with sensible defaults and capabilities for common tasks.
88

99
> **Note**
@@ -19,13 +19,17 @@ This library can be installed using pip, e.g.:
1919
pip install algokit-utils
2020
```
2121

22+
## Migration from `v2.x` to `v3.x`
23+
24+
Refer to the [v3 migration guide](./docs/source/v3-migration-guide.md) for more information on how to migrate to latest version of `algokit-utils-py`.
25+
2226
## Guiding principles
2327

2428
This library follows the [Guiding Principles of AlgoKit](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md#guiding-principles).
2529

2630
## Contributing
2731

28-
This is an open source project managed by the Algorand Foundation.
32+
This is an open source project managed by the Algorand Foundation.
2933
See the [AlgoKit contributing page](https://github.com/algorandfoundation/algokit-cli/blob/main/CONTRIBUTING.MD) to learn about making improvements.
3034

3135
To successfully run the tests in this repository you need to be running LocalNet via [AlgoKit](https://github.com/algorandfoundation/algokit-cli):

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)