Skip to content

feat: algokit-utils-py v3 implementation #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9389170
refactor: preparing codebase for gradual feature parity sync with uti…
aorumbayev Oct 22, 2024
1c77ad8
feat: TransactionComposer & AppManager implementation; various ongoin…
aorumbayev Nov 4, 2024
6cd11be
feat: AlgorandClientTransaction(Creator|Sender) and AssetManager abst…
aorumbayev Nov 6, 2024
62c121a
feat: AppClient, AppFactory, AppDeployer interface and various refine…
aorumbayev Dec 11, 2024
18744fe
chore: expose new interfaces
aorumbayev Dec 11, 2024
6bf71aa
refactor: further aligning composer class; initial batch of resource …
aorumbayev Dec 13, 2024
ec8cb13
chore: remaining resource packing related tests (#126)
aorumbayev Dec 16, 2024
92774f7
refactor: refining codebase; cleanup for initial beta release (#127)
aorumbayev Dec 20, 2024
8628075
feat: add offline_key_reg transaction to sender/creator/composer abst…
aorumbayev Dec 23, 2024
b3dec7f
docs: initial documentation for beta release (#128)
aorumbayev Dec 23, 2024
8024d37
refactor: refinements to support client generator v3 (#130)
aorumbayev Jan 22, 2025
a0efebc
refactor: remove AlgorandClientProtocol
aorumbayev Jan 22, 2025
06a59a9
refactor: removing AlgorandClientProtocol; extra type narrowing tweaks
aorumbayev Jan 22, 2025
dd75634
refactor: addressing pr comments
aorumbayev Jan 23, 2025
e9a9d63
docs: refining docstrings; enforcing sphinx styled format
aorumbayev Jan 23, 2025
64de8e4
Merge remote-tracking branch 'origin/main' into prerelease/ts-feature…
aorumbayev Jan 23, 2025
5abbed3
feat: refactoring the resource population to support cover appcall it…
aorumbayev Jan 24, 2025
42007ee
fix: further fixes revealed after refreshing generator against app ca…
aorumbayev Jan 25, 2025
8da2dfe
fix: add missing extra_program_pages calculation in method txn creation
aorumbayev Jan 25, 2025
1df5083
refactor: reusing OnSchemaBreak, OnUpdate, OperationPerformed
aorumbayev Jan 26, 2025
d01d90e
refactor: refine dataclasses; moving send and compilation params into…
aorumbayev Jan 26, 2025
b6e21fe
fix: remove skip signature for debug related simulate as it always tr…
aorumbayev Jan 26, 2025
f1036de
refactor: addressing pr comments
aorumbayev Jan 27, 2025
fc17da9
refactor: addressing pr comments
aorumbayev Jan 27, 2025
690b567
refactor: addressing pr comments
aorumbayev Jan 27, 2025
0755c87
docs: further refinements in capabilities .md files
aorumbayev Jan 28, 2025
1bf49e3
refactor: addressing pr comments
aorumbayev Jan 28, 2025
719e140
docs: typo in logic error description
aorumbayev Jan 28, 2025
cf14b5c
fix: improving regex usage in logic error message parser; bumping pyt…
aorumbayev Jan 28, 2025
f8cb58f
docs: refreshing documentation;
aorumbayev Jan 29, 2025
c14941b
docs: add migration note to readme
aorumbayev Jan 29, 2025
9af713d
docs: addressing pr comments
aorumbayev Jan 29, 2025
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
14 changes: 5 additions & 9 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ jobs:
- name: Check types with mypy
run: poetry run mypy

- name: Check docs are up to date
run: |
poetry run poe docs
git diff --quiet --exit-code \
':!docs/html/_sources/apidocs/algokit_utils/algokit_utils.md.txt' \
':!docs/html/apidocs/algokit_utils/algokit_utils.html' \
':!docs/html/searchindex.js' \
':!docs/markdown/apidocs/algokit_utils/algokit_utils.md' \
docs/
# TODO: Restore before prod release of v3
# - name: Check docs are up to date
# run: |
# poetry 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,6 @@ cython_debug/
/docs/source/apidocs

!docs/html

# Received approval test files
*.received.*
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repos:
additional_dependencies: []
minimum_pre_commit_version: "0"
files: "^(src|tests)/"
exclude: "^tests/artifacts/"
- id: mypy
name: mypy
description: "`mypy` will check Python types for correctness"
Expand All @@ -33,3 +34,11 @@ repos:
additional_dependencies: []
minimum_pre_commit_version: "2.9.2"
files: "^(src|tests)/"
exclude: "^tests/artifacts/"
- id: docstrings-check
name: docstrings-check
description: "Check docstrings for correctness"
entry: poetry run poe docstrings-check
language: system
types: [python]
files: "^(src)/"
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Python: Debug Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": [
"debug-test"
],
"console": "integratedTerminal",
"justMyCode": false
}
]
}
23 changes: 12 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@
"**/__pycache__": true,
".idea": true
},

// Python
"platformSettings.autoLoad": true,
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
"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.lint.args": [
"--config=pyproject.toml"
],
"ruff.importStrategy": "fromEnvironment",
"ruff.fixAll": true, //lint and fix all files in workspace
"ruff.organizeImports": true, //organize imports on save
Expand All @@ -37,7 +43,6 @@
"ruff.codeAction.fixViolation": {
"enable": true
},

"mypy.configFile": "pyproject.toml",
// set to empty array to use config from project
"mypy.targets": [],
Expand All @@ -52,11 +57,7 @@
}
]
},

// PowerShell
"[powershell]": {
"editor.defaultFormatter": "ms-vscode.powershell"
},
"powershell.codeFormatting.preset": "Stroustrup",
"python.testing.pytestArgs": ["."]
"python.testing.pytestArgs": [
"."
],
}
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# AlgoKit Python Utilities

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

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

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

## Migration from `v2.x` to `v3.x`

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`.

## Guiding principles

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

## Contributing

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

To successfully run the tests in this repository you need to be running LocalNet via [AlgoKit](https://github.com/algorandfoundation/algokit-cli):
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Loading
Loading