Skip to content

Commit a488ac3

Browse files
authored
chore: moving out algorand-python-testing from puya repo (#1)
* chore: moving out algorand-python-testing from puya repo * chore: addressing pr comments; adding ci; adding docs
1 parent 66ed184 commit a488ac3

File tree

151 files changed

+30850
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+30850
-0
lines changed

.coveragerc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[run]
2+
source = src/algopy
3+
4+
[report]
5+
show_missing = true
6+
skip_covered = true
7+
exclude_also =
8+
if .*TYPE_CHECKING:
9+
@(abc\.)?abstractmethod
10+
raise InternalError

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
root=true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
insert_final_newline = true
8+
9+
[{*.py,*.pyi}]
10+
max_line_length = 99
11+
12+
[*.md]
13+
max_line_length = 99
14+
15+
[*.yaml]
16+
quote_type = double
17+
18+
[.github/**.yaml]
19+
indent_size = 2
20+
21+
[.pre-commit-config.yaml]
22+
indent_size = 2
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: "\U0001F41C Bug report"
3+
about: Report a reproducible bug.
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
### Subject of the issue
10+
11+
<!-- Describe your issue here. -->
12+
13+
### Your environment
14+
15+
<!--
16+
* Please provide the version of the package used and output of `algokit doctor` command response,
17+
* This will give us a good idea about your environment
18+
-->
19+
20+
### Steps to reproduce
21+
22+
1.
23+
2.
24+
25+
### Expected behaviour
26+
27+
### Actual behaviour
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: "\U0001F514 Feature Request"
3+
about: Suggestions for how we can improve the algorand platform.
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem
10+
11+
<!-- What is the problem that we’re trying to solve? -->
12+
13+
## Solution
14+
15+
<!-- Do you have a potential/suggested solution? Document more than one if possible. -->
16+
17+
### Proposal
18+
19+
<!-- Describe the solution you’d like in detail. -->
20+
21+
### Pros and Cons
22+
23+
<!-- What are the advantages and disadvantages of this solution? -->
24+
25+
## Dependencies
26+
27+
<!-- Does the solution have any team or design dependencies? -->

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Proposed Changes
2+
3+
-
4+
-
5+
-

.github/workflows/cd.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Continuous Delivery of Algorand Python Testing package
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
publish_pypi:
7+
description: "Publish to PyPi?"
8+
type: boolean
9+
required: true
10+
default: false
11+
run_checks:
12+
description: "Run checks?"
13+
type: boolean
14+
required: true
15+
default: true
16+
dry_run:
17+
description: "Dry Run? If true, won't commit or publish anything"
18+
type: boolean
19+
required: true
20+
default: false
21+
22+
concurrency: release
23+
24+
permissions:
25+
contents: write
26+
packages: read
27+
28+
jobs:
29+
release:
30+
name: Release `algorand-python-testing` package
31+
runs-on: ubuntu-latest
32+
permissions:
33+
# IMPORTANT: this permission is mandatory for trusted publishing
34+
id-token: write
35+
contents: write
36+
packages: read
37+
env:
38+
DRY_RUN: ${{ inputs.dry_run && '--noop' || '' }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
43+
44+
- name: Install hatch
45+
run: pipx install hatch
46+
47+
- name: Set up Python 3.12
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.12"
51+
cache: "pip"
52+
53+
- name: Start LocalNet
54+
run: hatch run cicd:localnet_start
55+
56+
- name: Check pre-commits
57+
run: hatch run check
58+
59+
- name: Check pre-commits (examples)
60+
run: hatch run examples:check
61+
62+
- name: Check wheels can be built
63+
run: hatch build
64+
65+
- name: Run tests (codebase)
66+
run: hatch run test:codebase
67+
68+
- name: Run tests (examples)
69+
run: hatch run examples:tests
70+
71+
- name: Create Unit Testing Wheel
72+
run: hatch build
73+
74+
- uses: actions/upload-artifact@v4 # upload artifacts so they are retained on the job
75+
with:
76+
path: dist
77+
78+
- name: Publish to PyPI - Unit Testing
79+
if: ${{ !inputs.dry_run && inputs.publish_pypi }}
80+
uses: pypa/gh-action-pypi-publish@release/v1
81+
with:
82+
packages-dir: dist

.github/workflows/ci.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Check Python Code (algopy_testing)
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
7+
jobs:
8+
check-python:
9+
runs-on: "ubuntu-latest"
10+
steps:
11+
- name: Checkout source code
12+
uses: actions/checkout@v4
13+
14+
- name: Install hatch
15+
run: pipx install hatch
16+
17+
- name: Set up Python 3.12
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
cache: "pip"
22+
23+
- name: Start LocalNet
24+
run: hatch run cicd:localnet_start
25+
26+
- name: Check pre-commits
27+
run: hatch run check
28+
29+
- name: Check pre-commits (examples)
30+
run: hatch run examples:check
31+
32+
- name: Check wheels can be built
33+
run: hatch build
34+
35+
- name: Run tests (codebase)
36+
run: hatch run test:codebase
37+
38+
- name: Run tests (examples)
39+
run: hatch run examples:tests

.github/workflows/gh-pages.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Sphinx: Render + publish docs"
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
steps:
15+
- name: Checkout source code
16+
uses: actions/checkout@v4
17+
18+
- name: Install hatch
19+
run: pipx install hatch
20+
21+
- name: Set up Python 3.12
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
cache: "pip"
26+
27+
- name: Build doc
28+
run: hatch run docs:build
29+
30+
- name: Upload to GitHub pages
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: docs/_build
34+
35+
- name: Deploy to GitHub Pages
36+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.idea
2+
__pycache__
3+
.DS_Store
4+
examples/**/*.trace
5+
/_tmp
6+
# Sphinx documentation
7+
/docs/_build/
8+
# autogenerated doc
9+
/docs/apidocs/
10+
/docs/algopy-stubs/
11+
# wheel output
12+
/dist
13+
/stubs/dist
14+
# coverage output
15+
.coverage
16+
coverage.xml

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Python: Current File",
6+
"type": "python",
7+
"request": "launch",
8+
"program": "${file}",
9+
"console": "integratedTerminal",
10+
"justMyCode": true
11+
},
12+
{
13+
"name": "Debug Unit Test",
14+
"type": "python",
15+
"request": "test",
16+
"justMyCode": false
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)