This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: removing .env files and propagating conventions from python tem…
…plate (#70) * feat: removing .env files and propagating conventions from python template * chore: tmp changing the algokit instance
- Loading branch information
1 parent
2373a7f
commit 99af720
Showing
69 changed files
with
396 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
examples/generators/production_beaker_smart_contract_python/.algokit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...s/production_beaker_smart_contract_python/.algokit/generators/create_env_file/copier.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
_tasks: | ||
- "echo '==== Successfully generated new .env file 🚀 ===='" | ||
|
||
use_generic_env: | ||
type: bool | ||
help: Create generic empty .env file (true) or create a network specific .env.{network_name} file (false). | ||
placeholder: "true" | ||
default: "true" | ||
|
||
target_network: | ||
type: str | ||
help: Name of your target network. | ||
choices: | ||
- mainnet | ||
- testnet | ||
- localnet | ||
- custom | ||
default: "localnet" | ||
when: "{{ not use_generic_env }}" | ||
|
||
custom_network_name: | ||
type: str | ||
help: Name of your custom Algorand network. | ||
placeholder: "custom" | ||
when: "{{ not use_generic_env and target_network == 'custom' }}" | ||
|
||
_templates_suffix: ".j2" |
7 changes: 7 additions & 0 deletions
7
...e_generic_env and target_network == 'custom' %}.env.{{custom_network_name}}.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_TOKEN={YOUR_ALGOD_TOKEN} | ||
ALGOD_SERVER={YOUR_ALGOD_SERVER_URL} | ||
ALGOD_PORT={YOUR_ALGOD_PORT} | ||
INDEXER_TOKEN={YOUR_INDEXER_TOKEN} | ||
INDEXER_SERVER={YOUR_INDEXER_SERVER_URL} | ||
INDEXER_PORT={YOUR_INDEXER_PORT} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...le/{% if not use_generic_env and target_network == 'mainnet' %}.env.mainnet.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_SERVER=https://mainnet-api.algonode.cloud | ||
INDEXER_SERVER=https://mainnet-idx.algonode.cloud |
File renamed without changes.
Empty file.
1 change: 0 additions & 1 deletion
1
examples/generators/production_beaker_smart_contract_python/.env.template
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 9 additions & 15 deletions
24
examples/generators/production_beaker_smart_contract_python/tests/conftest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
from algokit_utils import ( | ||
get_algod_client, | ||
get_default_localnet_config, | ||
get_indexer_client, | ||
is_localnet, | ||
) | ||
from algosdk.v2client.algod import AlgodClient | ||
from algosdk.v2client.indexer import IndexerClient | ||
from dotenv import load_dotenv | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="session") | ||
def environment_fixture() -> None: | ||
env_path = Path(__file__).parent.parent / ".env.localnet" | ||
load_dotenv(env_path) | ||
# Uncomment if you want to load network specific or generic .env file | ||
# @pytest.fixture(autouse=True, scope="session") | ||
# def environment_fixture() -> None: | ||
# env_path = Path(__file__).parent.parent / ".env" | ||
# load_dotenv(env_path) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def algod_client() -> AlgodClient: | ||
client = get_algod_client() | ||
|
||
# you can remove this assertion to test on other networks, | ||
# included here to prevent accidentally running against other networks | ||
assert is_localnet(client) | ||
# by default we are using localnet algod | ||
client = get_algod_client(get_default_localnet_config("algod")) | ||
return client | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def indexer_client() -> IndexerClient: | ||
return get_indexer_client() | ||
return get_indexer_client(get_default_localnet_config("indexer")) |
6 changes: 5 additions & 1 deletion
6
examples/generators/production_beaker_smart_contract_typescript/.algokit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...oduction_beaker_smart_contract_typescript/.algokit/generators/create_env_file/copier.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
_tasks: | ||
- "echo '==== Successfully generated new .env file 🚀 ===='" | ||
|
||
use_generic_env: | ||
type: bool | ||
help: Create generic empty .env file (true) or create a network specific .env.{network_name} file (false). | ||
placeholder: "true" | ||
default: "true" | ||
|
||
target_network: | ||
type: str | ||
help: Name of your target network. | ||
choices: | ||
- mainnet | ||
- testnet | ||
- localnet | ||
- custom | ||
default: "localnet" | ||
when: "{{ not use_generic_env }}" | ||
|
||
custom_network_name: | ||
type: str | ||
help: Name of your custom Algorand network. | ||
placeholder: "custom" | ||
when: "{{ not use_generic_env and target_network == 'custom' }}" | ||
|
||
_templates_suffix: ".j2" |
7 changes: 7 additions & 0 deletions
7
...e_generic_env and target_network == 'custom' %}.env.{{custom_network_name}}.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_TOKEN={YOUR_ALGOD_TOKEN} | ||
ALGOD_SERVER={YOUR_ALGOD_SERVER_URL} | ||
ALGOD_PORT={YOUR_ALGOD_PORT} | ||
INDEXER_TOKEN={YOUR_INDEXER_TOKEN} | ||
INDEXER_SERVER={YOUR_INDEXER_SERVER_URL} | ||
INDEXER_PORT={YOUR_INDEXER_PORT} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...le/{% if not use_generic_env and target_network == 'mainnet' %}.env.mainnet.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_SERVER=https://mainnet-api.algonode.cloud | ||
INDEXER_SERVER=https://mainnet-idx.algonode.cloud |
File renamed without changes.
Empty file.
1 change: 0 additions & 1 deletion
1
examples/generators/production_beaker_smart_contract_typescript/.env.template
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
examples/generators/starter_beaker_smart_contract_python/.algokit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...tors/starter_beaker_smart_contract_python/.algokit/generators/create_env_file/copier.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
_tasks: | ||
- "echo '==== Successfully generated new .env file 🚀 ===='" | ||
|
||
use_generic_env: | ||
type: bool | ||
help: Create generic empty .env file (true) or create a network specific .env.{network_name} file (false). | ||
placeholder: "true" | ||
default: "true" | ||
|
||
target_network: | ||
type: str | ||
help: Name of your target network. | ||
choices: | ||
- mainnet | ||
- testnet | ||
- localnet | ||
- custom | ||
default: "localnet" | ||
when: "{{ not use_generic_env }}" | ||
|
||
custom_network_name: | ||
type: str | ||
help: Name of your custom Algorand network. | ||
placeholder: "custom" | ||
when: "{{ not use_generic_env and target_network == 'custom' }}" | ||
|
||
_templates_suffix: ".j2" |
7 changes: 7 additions & 0 deletions
7
...e_generic_env and target_network == 'custom' %}.env.{{custom_network_name}}.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_TOKEN={YOUR_ALGOD_TOKEN} | ||
ALGOD_SERVER={YOUR_ALGOD_SERVER_URL} | ||
ALGOD_PORT={YOUR_ALGOD_PORT} | ||
INDEXER_TOKEN={YOUR_INDEXER_TOKEN} | ||
INDEXER_SERVER={YOUR_INDEXER_SERVER_URL} | ||
INDEXER_PORT={YOUR_INDEXER_PORT} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...le/{% if not use_generic_env and target_network == 'mainnet' %}.env.mainnet.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_SERVER=https://mainnet-api.algonode.cloud | ||
INDEXER_SERVER=https://mainnet-idx.algonode.cloud |
File renamed without changes.
Empty file.
1 change: 0 additions & 1 deletion
1
examples/generators/starter_beaker_smart_contract_python/.env.template
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
examples/generators/starter_beaker_smart_contract_typescript/.algokit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
.../starter_beaker_smart_contract_typescript/.algokit/generators/create_env_file/copier.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
_tasks: | ||
- "echo '==== Successfully generated new .env file 🚀 ===='" | ||
|
||
use_generic_env: | ||
type: bool | ||
help: Create generic empty .env file (true) or create a network specific .env.{network_name} file (false). | ||
placeholder: "true" | ||
default: "true" | ||
|
||
target_network: | ||
type: str | ||
help: Name of your target network. | ||
choices: | ||
- mainnet | ||
- testnet | ||
- localnet | ||
- custom | ||
default: "localnet" | ||
when: "{{ not use_generic_env }}" | ||
|
||
custom_network_name: | ||
type: str | ||
help: Name of your custom Algorand network. | ||
placeholder: "custom" | ||
when: "{{ not use_generic_env and target_network == 'custom' }}" | ||
|
||
_templates_suffix: ".j2" |
7 changes: 7 additions & 0 deletions
7
...e_generic_env and target_network == 'custom' %}.env.{{custom_network_name}}.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_TOKEN={YOUR_ALGOD_TOKEN} | ||
ALGOD_SERVER={YOUR_ALGOD_SERVER_URL} | ||
ALGOD_PORT={YOUR_ALGOD_PORT} | ||
INDEXER_TOKEN={YOUR_INDEXER_TOKEN} | ||
INDEXER_SERVER={YOUR_INDEXER_SERVER_URL} | ||
INDEXER_PORT={YOUR_INDEXER_PORT} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...le/{% if not use_generic_env and target_network == 'mainnet' %}.env.mainnet.j2{% endif %}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# this file contains algorand network settings for interacting with testnet via algonode | ||
ALGOD_SERVER=https://mainnet-api.algonode.cloud | ||
INDEXER_SERVER=https://mainnet-idx.algonode.cloud |
File renamed without changes.
Empty file.
1 change: 0 additions & 1 deletion
1
examples/generators/starter_beaker_smart_contract_typescript/.env.template
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.