Skip to content

Commit

Permalink
feat: algokit-cli v2 (#462)
Browse files Browse the repository at this point in the history
* feat: Add puyapy compile integration (#457)

* feat: enable puya integration

* chore: doc

* chore: refactor compile command and enhance the docs

* docs: wording tweaks to the compile docs

* chore: change install to run, as I think it is the behaviour we want

* chore: fix snapshots

* fix: resolve issue running on windows

* chore: add info about PuyaPy Python version and matching behaviour.

* chore: fix snapshots

* chore: wording tweaks

* chore: allowing running puya with no color

* docs: adjust compile command terminology

---------

Co-authored-by: Neil Campbell <[email protected]>

* feat: command orchestration (#446)

* chore: algokit project poc

* feat: initial implementation

* chore: merge conflicts

* chore: fixing ruff errors

* chore: regen docs

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: minor refinements; adding env var passing; verbose validation

* chore: testing ci

* chore: patching docstrings

* chore: patching tests

* chore: testing ci

* docs: refining documentation and further polish

* chore: adding option to pass custom env file

* chore: addressing pr comments on docs

Co-authored-by: Neil Campbell <[email protected]>

* chore: fix line too long

* chore: removing typos; minor tweaks

* feat: linking and project listing commands (#450)

* chore: env_file file param; list command; link command

* chore: wip

* chore: wip

* chore: wip

* chore: wip

* chore: making deploy and bootstrap compatible with workspaces

* chore: wip

* chore: test

* chore: wip

* chore: wip

* feat: initial implementation of link and list commands; github folder handler

* chore: windows compatibility

* test: fixing windows compatibility

* chore: minor tweaks

* docs: pr feedback

Co-authored-by: Neil Campbell <[email protected]>

* chore: addressing pr feedback

* docs: regen docs

* chore: addressing pr feedback

* chore: minor refinements

* docs: minor paraphrasing of help strings

* chore: refining link behaviour; extra test case

---------

Co-authored-by: Neil Campbell <[email protected]>

* chore: merge conflicts

* chore: extra test cases

* fix: enforce utf-8 encoding to proc.run by default; do not resolve run cmd until run

* chore: addressing pr feedback

* chore: minor tweaks

* chore: adjusting beaker to point to feat branch

* chore: minor refinements

* chore: adding tealscript to point to temp feature branch

* chore: patching docs

* fix: adding search glob for arc32.json prefixed specs

* feat: orchestration pr feedback (#460)

* fix: addressing pr comments; minor improvements

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: testing ci

* chore: wip

* docs: regen docs

* fix: windows bug during git init

* chore: regen tests

* chore: fix test issues

* chore: minor refinements

* chore: renaming puya to python

* docs: regen docs

* chore: renaming puya template repo

* chore: merge conflicts

---------

Co-authored-by: Neil Campbell <[email protected]>

* chore: pin algokit client generator version (#455)

* chore: pin the generator client version by user

* fix: checking for available version

* fix: mypy issues

* test: adding tests

* chore: fix ruff errors

* chore: fix a test and ruff

* chore: update docs

* chore: add a log for a testing

* chore: update logs

* chore: revert the algokit-client-generator dependency

* chore: revert the lock file

* fix: github test on macos

* fix: get use of installed versions

* test: add tests

* fix: some tests

* test: fix some snapshots

* chore: fix ruff

* chore: fix test and pipx run command in windows

* feat: add support for finding a project installed python client generator command

* feat: add support for finding a globally installed ts client generator command

* chore: update docs

* chore: add some debug logs

* chore: update snapshots

* chore: add more tests

* chore: tweak

* chore: merging v2 into branch

* chore: remove orig

* chore: refine test cases for link command

---------

Co-authored-by: Neil Campbell <[email protected]>
Co-authored-by: Altynbek Orumbayev <[email protected]>

* chore: add version option to link command

* chore: minor fixes

* docs: update readme

* docs: add Algorand Python and TEALScript to readme

* chore: change puya to puyapy

* chore: fix windows compile test

* chore: fix test

* chore: ignore test for now

* chore: fix windows compile test

* chore: temporarily disable test

* fix: fixing an issue causing workspace nesting check even if user said yes to overwrite

* chore: use version rather than help for puyapy detects

* docs: update example contract in docs

* chore: removing tmp branches on templates

BREAKING CHANGE: 2.0 release

---------

Co-authored-by: Hoang Dinh <[email protected]>
Co-authored-by: Neil Campbell <[email protected]>
Co-authored-by: Negar <[email protected]>
  • Loading branch information
4 people authored Mar 27, 2024
1 parent b74778b commit 182c449
Show file tree
Hide file tree
Showing 249 changed files with 5,718 additions and 823 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-poetry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
run: |
pip install --user pipx
pipx ensurepath
pipx install poetry
pipx install poetry ${{ runner.os == 'macOS' && '--python "$Python_ROOT_DIR/bin/python"' || '' }}
shell: bash

- name: Get full Python version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install PuyaPy
if: ${{ matrix.python == '3.12' }}
run: pipx install puya
run: pipx install puyapy

- name: pytest
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
entry: poetry run ruff format
language: system
types: [python]
args: []
args: [--no-cache]
require_serial: true
additional_dependencies: []
minimum_pre_commit_version: "0"
Expand All @@ -17,7 +17,7 @@ repos:
entry: poetry run ruff
language: system
"types": [python]
args: [--fix]
args: [--fix, --no-cache]
require_serial: false
additional_dependencies: []
minimum_pre_commit_version: "0"
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ AlgoKit helps you develop Algorand solutions:
- **Development**: AlgoKit provides SDKs, tools and libraries that help you quickly and effectively build high quality Algorand solutions:
- **AlgoKit Utils** ([Python](https://github.com/algorandfoundation/algokit-utils-py#readme) | [TypeScript](https://github.com/algorandfoundation/algokit-utils-ts#readme)): A set of utility libraries so you can develop, test, build and deploy Algorand solutions quickly and easily
- [algosdk](https://developer.algorand.org/docs/sdks/) ([Python](https://github.com/algorand/py-algorand-sdk#readme) | [TypeScript](https://github.com/algorand/js-algorand-sdk#readme)) - The core Algorand SDK providing Algorand protocol API calls, which AlgoKit Utils wraps, but still exposes for advanced scenarios
- [**Beaker**](https://beaker.algo.xyz/): A productive Python framework for building Smart Contracts on Algorand.
- [PyTEAL](https://pyteal.readthedocs.io/en/stable/): The Python language bindings for Algorand Smart Contracts, which Beaker wraps
- [TEAL](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/): Transaction Execution Approval Language (TEAL) is the assembly-like language interpreted by the Algorand Virtual Machine (AVM) running within an Algorand node, which Beaker exports
- [**Algorand Python**](https://github.com/algorandfoundation/puya): A semantically and syntactically compatible, typed Python language that works with standard Python tooling and allows you to express smart contracts (apps) and smart signatures (logic signatures) for deployment on the Algorand Virtual Machine (AVM).
- [**TEALScript**](https://github.com/algorandfoundation/TEALScript): A subset of TypeScript that can be used to express smart contracts (apps) and smart signatures (logic signatures) for deployment on the Algorand Virtual Machine (AVM).
- [**AlgoKit LocalNet**](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/localnet.md): A local isolated Algorand network so you can simulate real transactions and workloads on your computer

### Operate
Expand All @@ -62,7 +61,7 @@ AlgoKit comes with out-of-the-box [Continuous Integration / Continuous Deploymen
The set of capabilities supported by AlgoKit will evolve over time, but currently includes:

- Quickly run, explore and interact with an isolated local Algorand network (LocalNet)
- Building, testing, deploying and calling [Algorand PyTEAL](https://github.com/algorand/pyteal) / [Beaker](https://beaker.algo.xyz/) smart contracts
- Building, testing, deploying and calling [Algorand Python](https://github.com/algorandfoundation/puya) / [TEALScript](https://github.com/algorandfoundation/TEALScript) smart contracts

For a user guide and guidance on how to use AlgoKit, please refer to the [docs](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md).

Expand All @@ -83,7 +82,7 @@ This is an open source project managed by the Algorand Foundation. See the [cont

## Prerequisites

The key required dependency is Python 3.10+, but some of the installation options below will install that for you.
The key required dependency is Python 3.10+, but some of the installation options below will install that for you. We recommend using Python 3.12+, as the `algokit compile python` command requires this version.

AlgoKit also has some runtime dependencies that also need to be available for particular commands.

Expand Down Expand Up @@ -126,10 +125,12 @@ AlgoKit can be installed using OS specific package managers, or using the python
> **App Installer python.exe** or **App Installer python3.exe**.
3. Install pipx:

```
pip install --user pipx
python -m pipx ensurepath
```
4. Restart the terminal to ensure pipx is available on the path
5. Install AlgoKit via pipx: `pipx install algokit`
6. Restart the terminal to ensure AlgoKit is available on the path
Expand Down
Loading

1 comment on commit 182c449

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py440%1–7
src/algokit/cli
   __init__.py47198%34
   completions.py108298%83, 98
   dispenser.py121199%77
   doctor.py49394%143–145
   explore.py501276%34–39, 41–46
   generate.py70396%76–77, 155
   goal.py44198%71
   init.py3092193%499–500, 524, 527–529, 540, 544, 602, 628, 657, 690, 699–701, 704–709, 722, 741, 753–754
   localnet.py1191587%74–78, 111, 123, 138–148, 161, 206, 227–228
   task.py34391%25–28
src/algokit/cli/common
   utils.py26292%120, 123
src/algokit/cli/project
   deploy.py992080%47, 49, 101, 124, 146–148, 227, 234, 248–256, 259–268
   link.py891682%60, 65–66, 101–105, 115–120, 148–149, 218–219, 223
   list.py33585%21–23, 51–56
   run.py46393%38, 71, 160
src/algokit/cli/tasks
   analyze.py81199%81
   assets.py821384%65–66, 72, 74–75, 105, 119, 125–126, 132, 134, 136–137
   ipfs.py51884%52, 80, 92, 94–95, 105–107
   mint.py66494%48, 70, 91, 250
   send_transaction.py651085%52–53, 57, 89, 158, 170–174
   sign_transaction.py59886%21, 28–30, 71–72, 109, 123
   transfer.py39392%26, 90, 117
   utils.py994555%26–34, 40–43, 75–76, 100–101, 125–133, 152–162, 209, 258–259, 279–290, 297–299
   vanity_address.py561082%41, 45–48, 112, 114, 121–123
   wallet.py79495%21, 66, 136, 162
src/algokit/core
   conf.py57984%12, 24, 28, 36, 38, 73–75, 80
   dispenser.py2022687%91, 123–124, 141–149, 191–192, 198–200, 218–219, 259–260, 318, 332–334, 345–346, 356, 369, 384
   doctor.py65789%67–69, 92–94, 134
   generate.py48394%44, 81, 99
   goal.py60395%30–31, 41
   init.py651085%51, 55–60, 68, 79, 86, 106–107
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py2181892%62, 73–75, 96, 142–149, 160, 457, 473, 498, 506
   typed_client_generation.py1732387%62–64, 77, 82, 86, 106–111, 135, 138–141, 159, 162–165, 232, 235–238
   utils.py1584671%51–52, 56–77, 134–140, 164, 167, 173–186, 207–209, 238–241, 263
   version_prompt.py921485%37–38, 68, 87–90, 108, 118–125, 148
src/algokit/core/compilers
   python.py28582%19–20, 25, 49–50
src/algokit/core/project
   __init__.py53394%50, 86, 145
   bootstrap.py120893%47, 125–126, 148, 175, 206–208
   deploy.py54983%61–64, 73–75, 79, 84
   run.py1251588%83, 88, 97–98, 133–134, 138–139, 143, 147, 261–269, 284
src/algokit/core/tasks
   analyze.py93397%105–112, 187
   ipfs.py63789%58–64, 140, 144, 146, 152
   nfd.py491373%25, 31, 34–41, 70–72, 99–101
   vanity_address.py903462%49–50, 54, 59–75, 92–108, 128–131
   wallet.py71593%37, 129, 155–157
src/algokit/core/tasks/mint
   mint.py781087%123–133, 187
   models.py901188%50, 52, 57, 71–74, 85–88
TOTAL428751588% 

Tests Skipped Failures Errors Time
482 0 💤 0 ❌ 0 🔥 34.107s ⏱️

Please sign in to comment.