Skip to content

Commit 64c9245

Browse files
authored
fix: mypy 1.11 pin; skipping clients on lsig compile; remove package-mode (#74)
* fix: mypy 1.11 pin; skipping clients on lsig compile; remove package-mode * chore: disabling tealer with snapshots by default (regular audit still runs) * fix: remove usage of poetry export
1 parent 42feefa commit 64c9245

File tree

33 files changed

+118
-102
lines changed

33 files changed

+118
-102
lines changed

examples/generators/production_python_smart_contract_python/.algokit.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ test = { commands = [
3333
'poetry run pytest',
3434
], description = 'Run smart contract tests' }
3535
audit = { commands = [
36-
'poetry export --without=dev -o requirements.txt',
37-
'poetry run pip-audit -r requirements.txt',
36+
'poetry run pip-audit',
3837
], description = 'Audit with pip-audit' }
3938
lint = { commands = [
4039
'poetry run black --check --diff .',

examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ jobs:
5353
- name: Scan TEAL files for issues
5454
run: algokit project run audit-teal --project-name 'production_python_smart_contract_python'
5555

56-
- name: Check output stability of the smart contracts
57-
run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_python'
56+
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
57+
# # Would first require running locally using audit-teal command and committing the snapshots into source control
58+
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
59+
# # https://github.com/crytic/tealer/issues/101
60+
# - name: Check output stability of the smart contracts
61+
# run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_python'
5862

5963
- name: Run deployer against LocalNet
6064
run: algokit project deploy localnet --project-name 'production_python_smart_contract_python'

examples/generators/production_python_smart_contract_python/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,5 @@ node_modules
176176

177177
# AlgoKit
178178
debug_traces/
179-
.algokit/static-analysis/tealer/
179+
.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI
180180
.algokit/sources

examples/generators/production_python_smart_contract_python/.pre-commit-config.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ repos:
3636
minimum_pre_commit_version: '2.9.2'
3737
files: '^(src|tests)/'
3838

39-
- id: tealer
40-
name: tealer
41-
description: "Run AlgoKit `Tealer` for TEAL static analysis"
42-
entry: algokit
43-
language: system
44-
args: [project, run, "audit-teal"]
45-
require_serial: false
46-
additional_dependencies: []
47-
minimum_pre_commit_version: "0"
48-
files: '^.*\.teal$'
39+
# # Uncomment to enable TEAL static analysis using Tealer package
40+
# - id: tealer
41+
# name: tealer
42+
# description: "Run AlgoKit `Tealer` for TEAL static analysis"
43+
# entry: algokit
44+
# language: system
45+
# args: [project, run, "audit-teal"]
46+
# require_serial: false
47+
# additional_dependencies: []
48+
# minimum_pre_commit_version: "0"
49+
# files: '^.*\.teal$'

examples/generators/production_python_smart_contract_python/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.1.0"
44
description = "Algorand smart contracts"
55
authors = ["None <None>"]
66
readme = "README.md"
7-
package-mode = false
87

98
[tool.poetry.dependencies]
109
python = "^3.12"
@@ -17,7 +16,7 @@ algorand-python-testing = "^0.4.0"
1716
algokit-client-generator = "^1.1.3"
1817
black = {extras = ["d"], version = "*"}
1918
ruff = "^0.1.6"
20-
mypy = "*"
19+
mypy = "1.11.0"
2120
pytest = "*"
2221
pytest-cov = "*"
2322
pip-audit = "*"

examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ def build(output_dir: Path, contract_path: Path) -> Path:
4141
raise Exception(f"Could not build contract:\n{build_result.stdout}")
4242

4343
app_spec_file_names = [file.name for file in output_dir.glob("*.arc32.json")]
44-
44+
app_spec_file_name = None
4545
for app_spec_file_name in app_spec_file_names:
4646
if app_spec_file_name is None:
47-
raise Exception(
48-
"Could not generate typed client, .arc32.json file not found"
47+
logger.warning(
48+
"No '*.arc32.json' file found (likely a logic signature being compiled). Skipping client generation."
4949
)
50+
continue
5051
print(app_spec_file_name)
5152
generate_result = subprocess.run(
5253
[
@@ -72,4 +73,4 @@ def build(output_dir: Path, contract_path: Path) -> Path:
7273
f"Could not generate typed client:\n{generate_result.stdout}"
7374
)
7475

75-
return output_dir / app_spec_file_name
76+
return output_dir / app_spec_file_name if app_spec_file_name else output_dir

examples/generators/production_python_smart_contract_typescript/.algokit.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ test = { commands = [
3333
'npm run test',
3434
], description = 'Run smart contract tests using Jest' }
3535
audit = { commands = [
36-
'poetry export --without=dev -o requirements.txt',
37-
'poetry run pip-audit -r requirements.txt',
36+
'poetry run pip-audit',
3837
], description = 'Audit with pip-audit' }
3938
lint = { commands = [
4039
'poetry run black --check --diff .',

examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ jobs:
5353
- name: Scan TEAL files for issues
5454
run: algokit project run audit-teal --project-name 'production_python_smart_contract_typescript'
5555

56-
- name: Check output stability of the smart contracts
57-
run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_typescript'
56+
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
57+
# # Would first require running locally using audit-teal command and committing the snapshots into source control
58+
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
59+
# # https://github.com/crytic/tealer/issues/101
60+
# - name: Check output stability of the smart contracts
61+
# run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_typescript'
5862

5963
- name: Run deployer against LocalNet
6064
run: algokit project deploy localnet --project-name 'production_python_smart_contract_typescript'

examples/generators/production_python_smart_contract_typescript/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,5 @@ node_modules
176176

177177
# AlgoKit
178178
debug_traces/
179-
.algokit/static-analysis/tealer/
179+
.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI
180180
.algokit/sources

examples/generators/production_python_smart_contract_typescript/.pre-commit-config.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ repos:
3636
minimum_pre_commit_version: '2.9.2'
3737
files: '^(src|tests)/'
3838

39-
- id: tealer
40-
name: tealer
41-
description: "Run AlgoKit `Tealer` for TEAL static analysis"
42-
entry: algokit
43-
language: system
44-
args: [project, run, "audit-teal"]
45-
require_serial: false
46-
additional_dependencies: []
47-
minimum_pre_commit_version: "0"
48-
files: '^.*\.teal$'
39+
# # Uncomment to enable TEAL static analysis using Tealer package
40+
# - id: tealer
41+
# name: tealer
42+
# description: "Run AlgoKit `Tealer` for TEAL static analysis"
43+
# entry: algokit
44+
# language: system
45+
# args: [project, run, "audit-teal"]
46+
# require_serial: false
47+
# additional_dependencies: []
48+
# minimum_pre_commit_version: "0"
49+
# files: '^.*\.teal$'

0 commit comments

Comments
 (0)