|
1 | | - |
| 1 | + <!-- markdownlint-disable-file MD041 --> |
2 | 2 |
|
| 3 | + |
3 | 4 |
|
4 | 5 | # PyTeal: Algorand Smart Contracts in Python |
5 | 6 |
|
|
8 | 9 | [](https://pyteal.readthedocs.io/en/latest/?badge=latest) |
9 | 10 | [](https://github.com/psf/black) |
10 | 11 |
|
11 | | -PyTeal is a Python language binding for [Algorand Smart Contracts (ASC1s)](https://developer.algorand.org/docs/features/asc1/). |
| 12 | +PyTeal is a Python language binding for [Algorand Smart Contracts (ASC1s)](https://developer.algorand.org/docs/features/asc1/). |
12 | 13 |
|
13 | | -Algorand Smart Contracts are implemented using a new language that is stack-based, |
14 | | -called [Transaction Execution Approval Language (TEAL)](https://developer.algorand.org/docs/features/asc1/teal/). |
| 14 | +Algorand Smart Contracts are implemented using a new language that is stack-based, |
| 15 | +called [Transaction Execution Approval Language (TEAL)](https://developer.algorand.org/docs/features/asc1/teal/). |
15 | 16 |
|
16 | | -However, TEAL is essentially an assembly language. With PyTeal, developers can express smart contract logic purely using Python. |
| 17 | +However, TEAL is essentially an assembly language. With PyTeal, developers can express smart contract logic purely using Python. |
17 | 18 | PyTeal provides high level, functional programming style abstractions over TEAL and does type checking at construction time. |
18 | 19 |
|
19 | | -### Install |
| 20 | +## Install |
20 | 21 |
|
21 | 22 | PyTeal requires Python version >= 3.10. |
22 | 23 |
|
23 | 24 | To manage multiple Python versions use tooling like [pyenv](https://github.com/pyenv/pyenv). |
24 | 25 |
|
25 | | -#### Recommended: Install from PyPi |
| 26 | +### Recommended: Install from PyPi |
26 | 27 |
|
27 | 28 | Install the latest official release from PyPi: |
28 | 29 |
|
29 | 30 | * `pip install pyteal` |
30 | 31 |
|
31 | | -#### Install Latest Commit |
| 32 | +### Install Latest Commit |
32 | 33 |
|
33 | 34 | If needed, it's possible to install directly from the latest commit on master to use unreleased features: |
34 | 35 |
|
35 | 36 | > **WARNING:** Unreleased code is experimental and may not be backwards compatible or function properly. Use extreme caution when installing PyTeal this way. |
36 | 37 |
|
37 | 38 | * `pip install git+https://github.com/algorand/pyteal` |
38 | 39 |
|
39 | | -### Documentation |
| 40 | +## Documentation |
40 | 41 |
|
41 | 42 | * [PyTeal Docs](https://pyteal.readthedocs.io/) |
42 | 43 | * `docs/` ([README](docs/README.md)) contains raw docs. |
43 | 44 |
|
44 | | -### Development Setup |
| 45 | +## Development Setup |
45 | 46 |
|
46 | 47 | Setup venv (one time): |
47 | | - * `python3 -m venv venv` |
| 48 | + |
| 49 | +* `python3 -m venv venv` |
48 | 50 |
|
49 | 51 | Active venv: |
50 | | - * `. venv/bin/activate` (if your shell is bash/zsh) |
51 | | - * `. venv/bin/activate.fish` (if your shell is fish) |
52 | 52 |
|
53 | | -Pip install PyTeal in editable state |
54 | | - * `pip install -e .` |
| 53 | +* `. venv/bin/activate` (if your shell is bash/zsh) |
| 54 | +* `. venv/bin/activate.fish` (if your shell is fish) |
| 55 | + |
| 56 | +Pip install PyTeal in editable state with dependencies: |
| 57 | + |
| 58 | +* `make setup-development` |
| 59 | +* OR if you don't have `make` installed: |
| 60 | + * `pip install -e.[development]` |
| 61 | + * Note, that if you're using `zsh` you'll need to escape the brackets: `pip install -e.\[development\]` |
55 | 62 |
|
56 | | -Install dependencies: |
57 | | -* `pip install -r requirements.txt` |
58 | | - |
59 | 63 | Type checking using mypy: |
| 64 | + |
60 | 65 | * `mypy pyteal` |
61 | 66 |
|
62 | 67 | Run tests: |
| 68 | + |
63 | 69 | * `pytest` |
64 | 70 |
|
65 | 71 | Format code: |
| 72 | + |
66 | 73 | * `black .` |
| 74 | + |
| 75 | +Lint using flake8: |
| 76 | + |
| 77 | +* `flake8 docs examples pyteal scripts tests *.py` |
0 commit comments