Skip to content

Beaker & PyTeal deprecation #34

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

Merged
merged 46 commits into from
Feb 7, 2025
Merged

Conversation

CiottiGiorgio
Copy link
Member

This PR consists of replacing the smart contracts in the examples folder with new ones written in Algorand Python.

@aorumbayev
Copy link
Contributor

@CiottiGiorgio i'd suggest holding this off until #33 is merged. PR will align examples with examples available on ts generator, the remaining steps on this pr would just imply fixing some merge conflicts (replacing non puya with puya).

@CiottiGiorgio
Copy link
Member Author

Thank you for heads up.

@CiottiGiorgio CiottiGiorgio requested a review from lempira January 24, 2025 15:45
# Conflicts:
#	examples/__main__.py
#	examples/helloworld/application.json
#	examples/helloworld/helloworld.py
#	examples/lifecycle/application.json
#	examples/lifecycle/lifecycle.py
#	examples/minimal/application.json
#	examples/minimal/minimal.py
#	examples/smart_contracts/artifacts/hello_world/hello_world_client.py
#	examples/smart_contracts/artifacts/lifecycle/lifecycle_client.py
#	examples/smart_contracts/artifacts/minimal/minimal_client.py
#	examples/smart_contracts/artifacts/state/state_client.py
#	examples/state/application.json
#	examples/state/state.py
#	examples/tests/test_hello_world_client.py
#	examples/tests/test_lifecycle_client.py
#	examples/tests/test_minimal_client.py
#	examples/tests/test_state_client.py
#	examples/tests/test_voting_client.py
#	examples/voting/application.json
#	examples/voting/client.py
#	examples/voting/voting.py
#	poetry.lock
#	pyproject.toml
#	scripts/update_approvals.py
#	tests/test_generator.py
# Conflicts:
#	examples/helloworld/test_client.py
#	examples/lifecycle/test_client.py
#	examples/smart_contracts/artifacts/hello_world/hello_world_client.py
#	examples/smart_contracts/artifacts/lifecycle/lifecycle_client.py
#	examples/smart_contracts/artifacts/minimal/minimal_client.py
#	examples/smart_contracts/artifacts/state/state_client.py
#	examples/state/test_client.py
#	examples/voting/client.py
#	examples/voting/test_client.py
#	poetry.lock
#	pyproject.toml
#	scripts/update_approvals.py
#	tests/test_generator.py
@CiottiGiorgio CiottiGiorgio marked this pull request as ready for review February 5, 2025 17:57
# Conflicts:
#	examples/smart_contracts/artifacts/hello_world/hello_world_client.py
#	examples/smart_contracts/artifacts/lifecycle/lifecycle_client.py
#	examples/smart_contracts/artifacts/minimal/minimal_client.py
#	examples/smart_contracts/artifacts/state/state_client.py
#	examples/tests/test_lifecycle_client.py
#	examples/voting/client.py
#	poetry.lock
#	pyproject.toml
@CiottiGiorgio
Copy link
Member Author

CiottiGiorgio commented Feb 6, 2025

@aorumbayev I noticed how the dev dependency for the latest compiler and algopy language bumped Python to 3.12.
This is even when the client generator is only used and not developed on. Is this problematic?

@aorumbayev
Copy link
Contributor

aorumbayev commented Feb 6, 2025

@CiottiGiorgio good point will double check in an hour or so if it's an issue (intent was likely to bump it only on dev dependencies)

@CiottiGiorgio
Copy link
Member Author

This happened on my side when I installed puya and algopy on this branch as dev deps. Looking forward to know if this causes issues but I'll look more into having two python version requirements for dev group and main group.

@CiottiGiorgio CiottiGiorgio force-pushed the feature/beaker-deprecation branch from 50415f7 to d3ecdf4 Compare February 6, 2025 14:55
Copy link

github-actions bot commented Feb 6, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit_client_generator
   __main__.py220%1–3
   cli.py48480%1–87
   document.py82791%44, 47, 49–50, 55, 74–75
   generator.py31197%23
   spec.py2071692%86, 116–119, 219–223, 253, 269, 350–351, 395, 410
   utils.py2194878%11, 20, 24, 28, 32, 36, 40, 44, 55, 58, 63–64, 75–76, 82–84, 89–91, 94–96, 99, 102, 105, 108–110, 159–160, 194, 198, 201–202, 218, 220, 231–232, 249, 261–264, 268, 278, 281, 283
src/algokit_client_generator/generators
   composer.py51198%29
   typed_client.py328898%59, 188, 287, 590, 680, 690, 729, 840
   typed_factory.py213399%64, 94, 227
TOTAL125213489% 

Tests Skipped Failures Errors Time
42 0 💤 0 ❌ 0 🔥 20.012s ⏱️

@aorumbayev aorumbayev self-requested a review February 6, 2025 15:17
…use it was manually recompiled with a version of puya that contains the bugfix
@CiottiGiorgio
Copy link
Member Author

This PR is waiting for this fix (algorandfoundation/puya#389) to make it into a release of puya because at the moment the state contract is manually recompiled using a nightly release.

pyproject.toml Outdated
setuptools = "^75.8.0"
pytest-sugar = "^1.0.0"
inflection = "^0.5.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CiottiGiorgio do you really need an whole dependency for a single to camel case use case? Also looks like the dependency is not actively maintained https://github.com/jpvanhal/inflection (no commits since 2020)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CiottiGiorgio see utils.py file in src, there are various formatters and sanitizers you can reuse, for instance you can make to_camel_case by reusing the to_pascal_case method and making first char lowercase?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def to_camel_case(value: str) -> str:
    pascal_case = to_pascal_case(value)
    return pascal_case[0].lower() + pascal_case[1:]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@CiottiGiorgio
Copy link
Member Author

Review comments and bugfixes are addressed. Ready for a last pass of review if necessary

@CiottiGiorgio CiottiGiorgio merged commit f9ef7a1 into main Feb 7, 2025
6 checks passed
@CiottiGiorgio CiottiGiorgio deleted the feature/beaker-deprecation branch February 10, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants