Skip to content

Commit

Permalink
fix: patching algopy import syntax in hello world (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev authored Jun 27, 2024
1 parent 550eaff commit 3880851
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ audit = { commands = [
'poetry run pip-audit -r requirements.txt',
], description = 'Audit with pip-audit' }
lint = { commands = [
'poetry run black --check .',
'poetry run black --check --diff .',
'poetry run ruff check .',
'poetry run mypy',
], description = 'Perform linting' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class CoolContract(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class HelloWorld(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ audit = { commands = [
'poetry run pip-audit -r requirements.txt',
], description = 'Audit with pip-audit' }
lint = { commands = [
'poetry run black --check .',
'poetry run black --check --diff .',
'poetry run ruff check .',
'poetry run mypy',
], description = 'Perform linting' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class CoolContract(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class HelloWorld(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class CoolContract(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class HelloWorld(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class CoolContract(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class HelloWorld(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
2 changes: 1 addition & 1 deletion examples/production_python/.algokit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ audit = { commands = [
'poetry run pip-audit -r requirements.txt',
], description = 'Audit with pip-audit' }
lint = { commands = [
'poetry run black --check .',
'poetry run black --check --diff .',
'poetry run ruff check .',
'poetry run mypy',
], description = 'Perform linting' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class HelloWorld(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class HelloWorld(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
2 changes: 1 addition & 1 deletion template_content/.algokit.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ audit = { commands = [
{%- endif %}
lint = { commands = [
{%- if use_python_black %}
'poetry run black --check .',
'poetry run black --check --diff .',
{%- endif %}
{%- if python_linter == 'ruff' %}
'poetry run ruff check .',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from algopy import ARC4Contract, arc4
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod


class {{ contract_name.split('_')|map('capitalize')|join }}(ARC4Contract):
@arc4.abimethod()
def hello(self, name: arc4.String) -> arc4.String:
@abimethod()
def hello(self, name: String) -> String:
return "Hello, " + name

0 comments on commit 3880851

Please sign in to comment.