Skip to content
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

Basic Project Setup + Migrating Code from PySDK PR #298 #1

Merged
merged 87 commits into from Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
e2e4d44
basic python setup and github attempt with blackbox
Mar 25, 2022
a9bc043
try again with what I assumed was a superfluous apt update
Mar 25, 2022
9ad712d
sandbox smoke test
Mar 25, 2022
6d8272a
teal files for blackbox tests
Mar 25, 2022
882d186
integration and unit test stubs - can we pass git actions?
Mar 25, 2022
6d214b7
compromise on py 3.8
Mar 25, 2022
c36b8dd
pwd too
Mar 25, 2022
fc5a59c
teals moved to tests/ directory
Mar 25, 2022
cfe8d08
markdownlint
Mar 25, 2022
b036daa
tabulate
Mar 25, 2022
5a4dfcb
don't try to publish inside the docker
Mar 25, 2022
7a6754d
unit-test not build-and-test
Mar 25, 2022
2956b58
.PHONY and remove unused commands
Mar 25, 2022
6b739bb
working with act!
Mar 25, 2022
ac23fb9
@barnjamin's solution crops up again https://github.com/algorand/sand…
Mar 25, 2022
bc37fd6
combine `script -e -c` with `bash -x`
Mar 25, 2022
a84ac01
more network config info
Mar 25, 2022
410187e
break up into mac and github specific commands
Mar 26, 2022
fab5acb
should work on github as well
Mar 26, 2022
df55a5d
expect sandbox exit code 2 on github because missing indexer
Mar 26, 2022
1752366
missing left bracket
Mar 26, 2022
9cdb3f9
simpler no-fail sandbox test
Mar 26, 2022
b7a5e50
mac-gh-simulate
Mar 26, 2022
cfdaaf3
re-create teal_blackbox
Mar 26, 2022
9c41ee6
edits
Mar 26, 2022
b0489d5
DryRunInspector and other refactorings
Mar 26, 2022
dd97d25
edits and proofs that examples are working
Mar 26, 2022
b44d75c
pass step 5 of docs test
Mar 26, 2022
083c92f
break higher-level Invariant into its own file
Mar 26, 2022
980790d
thru step 8
Mar 26, 2022
a8c7eab
sequence assertions -> invariants and pass all the doc tests
Mar 26, 2022
e36cea7
final draft
Mar 26, 2022
dfc8849
fix links etc.
Mar 26, 2022
4da7415
test the doc exercises too
Mar 26, 2022
c445857
Update Makefile
tzaffi Mar 26, 2022
82c8cff
Update Makefile
tzaffi Mar 26, 2022
5351bd4
alignment
Mar 26, 2022
d41586c
better explanation
Mar 26, 2022
c4026bc
final tweaks... realy
Mar 26, 2022
e9b29e8
Ignore PyCharm files
michaeldiamant Mar 29, 2022
42face9
mac- --> local- and other experimental tweaks
Mar 29, 2022
b1389af
... literally, in imports
Mar 29, 2022
30510ca
Run integration tests on Python 3.10
michaeldiamant Mar 29, 2022
315560a
Try to make Python env value available
michaeldiamant Mar 29, 2022
b960a40
Revert to hard-coded matrix version
michaeldiamant Mar 29, 2022
e73e624
Try quoting values to fix error
michaeldiamant Mar 29, 2022
b70e4c4
Try quoting more values
michaeldiamant Mar 29, 2022
5535317
try packge_dir instead of packages
Mar 29, 2022
06c1417
try setup.py again
Mar 29, 2022
9ca637e
try gin
Mar 29, 2022
9f21ca4
maybe the init...
Mar 29, 2022
94e3063
try gingin
Mar 29, 2022
16896f2
try gin
Mar 29, 2022
35a11ba
try gin
Mar 29, 2022
827ebbd
try gin
Mar 29, 2022
f4570eb
try gin
Mar 29, 2022
e36ad8f
try gin
Mar 29, 2022
9796c8a
remove setup.cfg
Mar 29, 2022
4433073
try to make do without requirements.txt
Mar 29, 2022
32c90ce
Merge branch 'github-actions' into github-actions_python3.10_action
Mar 29, 2022
e2f004a
merge with head and get act to pass
Mar 29, 2022
aff0ad4
Merge pull request #8 from algorand/github-actions_python3.10_action
tzaffi Mar 29, 2022
43de4f6
fix import
Mar 29, 2022
72d14b8
bring our changes to the top of the .gitignore
Mar 29, 2022
621435c
Update README.md
tzaffi Mar 29, 2022
d64c640
Update README.md
tzaffi Mar 29, 2022
94651ab
Update README.md
tzaffi Mar 29, 2022
8579ad9
Update Makefile
tzaffi Mar 29, 2022
af96c29
Update Makefile
tzaffi Mar 29, 2022
b18f2c4
Update README.md
tzaffi Mar 29, 2022
948d438
Update README.md
tzaffi Mar 29, 2022
10539ac
Update README.md
tzaffi Mar 29, 2022
815ce5f
i -> args
Mar 29, 2022
29f2f7e
per CR suggestions
Mar 30, 2022
ef4987c
black
Mar 30, 2022
cf99b0e
flake8
Mar 30, 2022
4802591
Update setup.cfg
tzaffi Mar 30, 2022
54c2b60
per CR suggestions
Mar 30, 2022
7393880
remove commented out code
Mar 30, 2022
be41d27
delete commented out code
Mar 30, 2022
b0533b7
changelog with versioning proposal
Mar 30, 2022
537767a
sign the tag too!
Mar 30, 2022
7a06838
try 3 python version of integration tests on github
Mar 30, 2022
1c110f3
per CR suggestions and remove (confusing and unused) PYTHON_VERSION
Mar 30, 2022
4443fea
per CR suggestions
Mar 30, 2022
0f49517
yes, github actions depend on Makefile
Mar 30, 2022
ba03151
bad ref
Mar 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
@@ -0,0 +1,2 @@
[flake8]
ignore = E501, W503
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,78 @@
name: "Build workflow"
on:
pull_request:
push:
tags:
- v**
branches:
- main

env:
SANDBOX_CONFIG: dev
SANDBOX_GENESIS: genesis/dev/genesis.json

jobs:
build-test:
runs-on: ubuntu-20.04
container: python:${{ matrix.python }}
strategy:
matrix:
python: [ "3.8", "3.9", "3.10" ]
steps:
- run: python3 --version
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: pip, lint, and units
run: make build-and-test
run-integration-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python: [ "3.8", "3.9", "3.10" ]
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python }}"
- name: Test Python version
run: |
installed="$(python --version)"
expected="${{ matrix.python }}"
echo $installed
[[ $installed =~ "Python ${expected}" ]] && echo "Configured Python" || (echo "Failed to configure Python" && exit 1)
- name: Install required os level applications
run: |
sudo apt update -y
sudo apt install -y curl git nodejs
sudo apt -y install ca-certificates curl gnupg lsb-release
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt -y install docker-ce docker-ce-cli containerd.io
- name: Setup docker compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
- name: Check cache for Docker layers
uses: satackey/action-docker-layer-caching@v0.0.11
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
with:
key: docker-layer-caching-${{ github.workflow }}-${{ hashFiles(env.SANDBOX_CONFIG, env.SANDBOX_GENESIS) }}-{hash}
restore-keys: docker-layer-caching-${{ github.workflow }}-${{ hashFiles(env.CONFIG, env.SANDBOX_GENESIS) }}-
- name: Create sandbox
uses: lucasvanmol/algorand-sandbox-action@v1
with:
config: ${{ env.SANDBOX_CONFIG }}
- name: Setup integration test environment
run: make pip-development unit-test
- name: Run integration tests
run: make gh-blackbox
22 changes: 22 additions & 0 deletions .gitignore
@@ -1,3 +1,23 @@
##### graviton specific ignores #####

# Integration tests
.sandbox
sandbox

# Comma Seperated Value reports
*.csv

# Emacs detritus
*~

# VS Code detritus
.vscode

# IDE
.idea

##### BEGIN: github recommends for Python #####

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -127,3 +147,5 @@ dmypy.json

# Pyre type checker
.pyre/

##### END: github recommends for Python #####
24 changes: 24 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,24 @@
# Changelog

## Versioning Legend

Versioning is in Animal Emoji Lexicographical Order (AELO). For example:

1. 🦙 (Alpaca)
2. 🐗 (Boar)
3. 🐈 (Cat)

... etc ...

## Tagging Cheatsheet

* create an annotated tag:
* `git tag -as 🦙 -m "productionize graviton" && git push origin 🦙`
* get tag details:
* `git show 🦙`

## 🦙 (Alpaca)

### Added

* Basic functionality
60 changes: 60 additions & 0 deletions Makefile
@@ -0,0 +1,60 @@
####### Universal ######

pip:
pip install -e .

pip-development: pip
pip install -e.[development]

flake8:
flake8 graviton tests

black:
black --check .

lint: black flake8

unit-test:
pytest -sv tests/unit

build-and-test: pip-development lint unit-test

blackbox-smoke-prefix:
echo "hello blackbox!"
pwd
ls -l
ls -l sandbox
cd sandbox && docker-compose ps

integration-test:
pytest -sv tests/integration


michaeldiamant marked this conversation as resolved.
Show resolved Hide resolved
###### Local Only ######

# assumes installations of pipx, build and tox via:
# `pip install pipx; pipx install build; pipx install tox`
local-project-build:
pyproject-build

# assumes a symbolic link: sandbox -> /cloned/repo/algorand/sandbox
local-sandbox-test:
./sandbox/sandbox test

local-blackbox-smoke: blackbox-smoke-prefix local-sandbox-test

local-blackbox: local-blackbox-smoke integration-test

# assumes act is installed, e.g. via `brew install act`:
local-gh-simulate:
act

###### Github Actions Only ######

gh-sandbox-test:
# relax exit code condition because indexer returns 500 when last-round = 0
script -e -c "bash -x ./sandbox/sandbox test" || echo "finished ./sandbox test"

gh-blackbox-smoke: blackbox-smoke-prefix gh-sandbox-test

gh-blackbox: gh-blackbox-smoke integration-test