diff --git a/examples/generators/production_python_smart_contract_python/.algokit.toml b/examples/generators/production_python_smart_contract_python/.algokit.toml index 6ebb852..9afc114 100644 --- a/examples/generators/production_python_smart_contract_python/.algokit.toml +++ b/examples/generators/production_python_smart_contract_python/.algokit.toml @@ -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' } diff --git a/examples/generators/production_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 b/examples/generators/production_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 index 0fb0bc7..829e3a0 100644 --- a/examples/generators/production_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 +++ b/examples/generators/production_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 @@ -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 diff --git a/examples/generators/production_python_smart_contract_python/smart_contracts/cool_contract/contract.py b/examples/generators/production_python_smart_contract_python/smart_contracts/cool_contract/contract.py index d4aca2c..271ad93 100644 --- a/examples/generators/production_python_smart_contract_python/smart_contracts/cool_contract/contract.py +++ b/examples/generators/production_python_smart_contract_python/smart_contracts/cool_contract/contract.py @@ -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 diff --git a/examples/generators/production_python_smart_contract_python/smart_contracts/hello_world/contract.py b/examples/generators/production_python_smart_contract_python/smart_contracts/hello_world/contract.py index a0b333a..8a8d12b 100644 --- a/examples/generators/production_python_smart_contract_python/smart_contracts/hello_world/contract.py +++ b/examples/generators/production_python_smart_contract_python/smart_contracts/hello_world/contract.py @@ -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 diff --git a/examples/generators/production_python_smart_contract_typescript/.algokit.toml b/examples/generators/production_python_smart_contract_typescript/.algokit.toml index 3cb1106..08ffaf7 100644 --- a/examples/generators/production_python_smart_contract_typescript/.algokit.toml +++ b/examples/generators/production_python_smart_contract_typescript/.algokit.toml @@ -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' } diff --git a/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 b/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 index 0fb0bc7..829e3a0 100644 --- a/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 +++ b/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 @@ -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 diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py b/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py index d4aca2c..271ad93 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py @@ -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 diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/contract.py b/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/contract.py index a0b333a..8a8d12b 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/contract.py +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/contract.py @@ -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 diff --git a/examples/generators/starter_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 b/examples/generators/starter_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 index 0fb0bc7..829e3a0 100644 --- a/examples/generators/starter_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 +++ b/examples/generators/starter_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 @@ -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 diff --git a/examples/generators/starter_python_smart_contract_python/smart_contracts/cool_contract/contract.py b/examples/generators/starter_python_smart_contract_python/smart_contracts/cool_contract/contract.py index d4aca2c..271ad93 100644 --- a/examples/generators/starter_python_smart_contract_python/smart_contracts/cool_contract/contract.py +++ b/examples/generators/starter_python_smart_contract_python/smart_contracts/cool_contract/contract.py @@ -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 diff --git a/examples/generators/starter_python_smart_contract_python/smart_contracts/hello_world/contract.py b/examples/generators/starter_python_smart_contract_python/smart_contracts/hello_world/contract.py index a0b333a..8a8d12b 100644 --- a/examples/generators/starter_python_smart_contract_python/smart_contracts/hello_world/contract.py +++ b/examples/generators/starter_python_smart_contract_python/smart_contracts/hello_world/contract.py @@ -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 diff --git a/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 b/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 index 0fb0bc7..829e3a0 100644 --- a/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 +++ b/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 @@ -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 diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py index d4aca2c..271ad93 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/contract.py @@ -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 diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/contract.py b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/contract.py index a0b333a..8a8d12b 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/contract.py +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/contract.py @@ -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 diff --git a/examples/production_python/.algokit.toml b/examples/production_python/.algokit.toml index 58d90ea..8f08db0 100644 --- a/examples/production_python/.algokit.toml +++ b/examples/production_python/.algokit.toml @@ -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' } diff --git a/examples/production_python/smart_contracts/hello_world/contract.py b/examples/production_python/smart_contracts/hello_world/contract.py index a0b333a..8a8d12b 100644 --- a/examples/production_python/smart_contracts/hello_world/contract.py +++ b/examples/production_python/smart_contracts/hello_world/contract.py @@ -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 diff --git a/examples/starter_python/smart_contracts/hello_world/contract.py b/examples/starter_python/smart_contracts/hello_world/contract.py index a0b333a..8a8d12b 100644 --- a/examples/starter_python/smart_contracts/hello_world/contract.py +++ b/examples/starter_python/smart_contracts/hello_world/contract.py @@ -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 diff --git a/template_content/.algokit.toml.jinja b/template_content/.algokit.toml.jinja index 9ecaf47..7efab4b 100644 --- a/template_content/.algokit.toml.jinja +++ b/template_content/.algokit.toml.jinja @@ -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 .', diff --git a/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/contract.py.j2 b/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/contract.py.j2 index 0fb0bc7..829e3a0 100644 --- a/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/contract.py.j2 +++ b/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/contract.py.j2 @@ -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 diff --git a/template_content/smart_contracts/{{ contract_name }}/contract.py.jinja b/template_content/smart_contracts/{{ contract_name }}/contract.py.jinja index 9828347..50ce4ca 100644 --- a/template_content/smart_contracts/{{ contract_name }}/contract.py.jinja +++ b/template_content/smart_contracts/{{ contract_name }}/contract.py.jinja @@ -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