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
Changes from 64 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
a9bc043
try again with what I assumed was a superfluous apt update
9ad712d
sandbox smoke test
6d8272a
teal files for blackbox tests
882d186
integration and unit test stubs - can we pass git actions?
6d214b7
compromise on py 3.8
c36b8dd
pwd too
fc5a59c
teals moved to tests/ directory
cfe8d08
markdownlint
b036daa
tabulate
5a4dfcb
don't try to publish inside the docker
7a6754d
unit-test not build-and-test
2956b58
.PHONY and remove unused commands
6b739bb
working with act!
ac23fb9
@barnjamin's solution crops up again https://github.com/algorand/sand…
bc37fd6
combine `script -e -c` with `bash -x`
a84ac01
more network config info
410187e
break up into mac and github specific commands
fab5acb
should work on github as well
df55a5d
expect sandbox exit code 2 on github because missing indexer
1752366
missing left bracket
9cdb3f9
simpler no-fail sandbox test
b7a5e50
mac-gh-simulate
cfdaaf3
re-create teal_blackbox
9c41ee6
edits
b0489d5
DryRunInspector and other refactorings
dd97d25
edits and proofs that examples are working
b44d75c
pass step 5 of docs test
083c92f
break higher-level Invariant into its own file
980790d
thru step 8
a8c7eab
sequence assertions -> invariants and pass all the doc tests
e36cea7
final draft
dfc8849
fix links etc.
4da7415
test the doc exercises too
c445857
Update Makefile
tzaffi 82c8cff
Update Makefile
tzaffi 5351bd4
alignment
d41586c
better explanation
c4026bc
final tweaks... realy
e9b29e8
Ignore PyCharm files
michaeldiamant 42face9
mac- --> local- and other experimental tweaks
b1389af
... literally, in imports
30510ca
Run integration tests on Python 3.10
michaeldiamant 315560a
Try to make Python env value available
michaeldiamant b960a40
Revert to hard-coded matrix version
michaeldiamant e73e624
Try quoting values to fix error
michaeldiamant b70e4c4
Try quoting more values
michaeldiamant 5535317
try packge_dir instead of packages
06c1417
try setup.py again
9ca637e
try gin
9f21ca4
maybe the init...
94e3063
try gingin
16896f2
try gin
35a11ba
try gin
827ebbd
try gin
f4570eb
try gin
e36ad8f
try gin
9796c8a
remove setup.cfg
4433073
try to make do without requirements.txt
32c90ce
Merge branch 'github-actions' into github-actions_python3.10_action
e2f004a
merge with head and get act to pass
aff0ad4
Merge pull request #8 from algorand/github-actions_python3.10_action
tzaffi 43de4f6
fix import
72d14b8
bring our changes to the top of the .gitignore
621435c
Update README.md
tzaffi d64c640
Update README.md
tzaffi 94651ab
Update README.md
tzaffi 8579ad9
Update Makefile
tzaffi af96c29
Update Makefile
tzaffi b18f2c4
Update README.md
tzaffi 948d438
Update README.md
tzaffi 10539ac
Update README.md
tzaffi 815ce5f
i -> args
29f2f7e
per CR suggestions
ef4987c
black
cf99b0e
flake8
4802591
Update setup.cfg
tzaffi 54c2b60
per CR suggestions
7393880
remove commented out code
be41d27
delete commented out code
b0533b7
changelog with versioning proposal
537767a
sign the tag too!
7a06838
try 3 python version of integration tests on github
1c110f3
per CR suggestions and remove (confusing and unused) PYTHON_VERSION
4443fea
per CR suggestions
0f49517
yes, github actions depend on Makefile
ba03151
bad ref
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: "Build workflow" | ||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- v** | ||
branches: | ||
- main | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" # Duplicated in `build-test` due to Workflow limitations. | ||
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.10" ] | ||
steps: | ||
- run: python3 --version | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install pip dependencies | ||
run: make pip-test | ||
- name: build-and-test | ||
run: make unit-test | ||
run-integration-tests: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "${{ env.PYTHON_VERSION }}" | ||
- name: Test Python version | ||
run: | | ||
installed="$(python --version)" | ||
expected="${{ env.PYTHON_VERSION }}" | ||
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-test unit-test | ||
- name: Run integration tests | ||
run: make gh-blackbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
####### Universal ###### | ||
|
||
pip: | ||
pip install -e . | ||
|
||
pip-test: pip | ||
pip install -e.[test] | ||
|
||
|
||
unit-test: | ||
pytest -sv tests/unit | ||
|
||
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
|
||
###### Mac Only ###### | ||
tzaffi marked this conversation as resolved.
Show resolved
Hide resolved
tzaffi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# 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 | ||
|
||
.PHONY: pip-publish pip-test unit-test gh-blackbox | ||
tzaffi marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasonpaulos - per our conversation, I'm recommending going with the approach of having a special "test" imports using
setup.py
'srequire_extras
dict and removingrequirements.txt
altogether.Some brief research shows that there is PEP 621 will give a different solution in the future, but AFAIK no version of
pip
yet supports this. Therefore, I'm going with the next best option, in my opinion, which is discussed here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can accept this, though I'd suggestion
development
or similar instead of justtest
. The dev process involves more than just tests, there are also linters, formatters, etc. that help us write code.