From 659a10c4f7fd95ec250d78d1017831ad958fa6a5 Mon Sep 17 00:00:00 2001 From: Inaie Ignacio <129017070+inaie-makerx@users.noreply.github.com> Date: Mon, 23 Oct 2023 18:52:23 +0800 Subject: [PATCH] feat: add jetbrains compatibility (#43) * feat: add question on copier * feat: add idea configuration * feat: update tests copier-answers * chore: test * chore: refining tests; fixing os specific path issue * chore: updating gitattributes * feat: add configuration files * feat: update unit test * fix: the sdk name reference * fix: configuration * fix: configuration * fix: configuration files to read env files * feat: add required plugins * fix: configuration files * fix: pr review * fix: unit tests change * chore: testing wip * chore: refining terminology regarding which jetbrain ide its aimed for * build: updating beaker/algokit-utils dependencies * chore: adding note on windows compatibility * chore: adding xdist; removing redundant tests --------- Co-authored-by: Altynbek Orumbayev --- .gitattributes | 2 +- .github/workflows/check-python.yaml | 2 +- .gitignore | 6 +- copier.yaml | 310 +++++++++--------- poetry.lock | 90 ++--- pyproject.toml | 1 + template_content/.gitignore.jinja | 6 +- template_content/README.md.jinja | 4 +- template_content/pyproject.toml.jinja | 4 +- .../externalDependencies.xml | 6 + .../Build_Beaker_application.xml.jinja | 35 ++ ...d_Beaker_application____LocalNet.xml.jinja | 37 +++ .../Reset_AlgoKit_LocalNet.xml | 17 + .../Start_AlgoKit_LocalNet.xml | 17 + .../Stop_AlgoKit_LocalNet.xml | 17 + ...oy_Beaker_application.xml{% endif %}.jinja | 38 +++ ...lt_Beaker_application.xml{% endif %}.jinja | 36 ++ ...oy_Beaker_application.xml{% endif %}.jinja | 18 + ...lt_Beaker_application.xml{% endif %}.jinja | 16 + tests/test_templates.py | 20 +- .../.copier-answers.yml | 1 + .../test_default_parameters/.gitignore | 6 +- .../test_default_parameters/README.md | 4 +- .../test_default_parameters/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../.gitignore | 6 +- .../test_deployment_language-python/README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../.gitignore | 6 +- .../README.md | 4 +- .../pyproject.toml | 4 +- .../.algokit.toml | 0 .../.copier-answers.yml | 3 +- .../.editorconfig | 0 .../.env.localnet.template | 0 .../.env.template | 0 .../.env.testnet.template | 0 .../.gitattributes | 0 .../.gitignore | 6 +- .../.vscode/extensions.json | 0 .../.vscode/launch.json | 0 .../.vscode/settings.json | 0 .../.vscode/tasks.json | 0 .../README.md | 6 +- .../poetry.toml | 0 .../pyproject.toml | 6 +- .../smart_contracts/README.md | 0 .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 0 .../smart_contracts/config.py | 0 .../smart_contracts/hello_world/contract.py | 0 .../hello_world/deploy_config.py | 0 .../smart_contracts/helpers/__init__.py | 0 .../smart_contracts/helpers/build.py | 0 .../smart_contracts/helpers/deploy.py | 0 .../tests/__init__.py | 0 .../tests/conftest.py | 0 .../tests/hello_world_test.py | 0 .../.algokit.toml | 0 .../.copier-answers.yml | 3 +- .../.editorconfig | 0 .../.env.localnet.template | 0 .../.env.template | 0 .../.env.testnet.template | 0 .../.gitattributes | 0 .../.gitignore | 6 +- .../Build_Beaker_application.xml | 35 ++ .../Build_Beaker_application____LocalNet.xml | 37 +++ .../Build___Deploy_Beaker_application.xml | 38 +++ .../Deploy_Built_Beaker_application.xml | 36 ++ .../Reset_AlgoKit_LocalNet.xml | 17 + .../Start_AlgoKit_LocalNet.xml | 17 + .../Stop_AlgoKit_LocalNet.xml | 17 + .../.vscode/extensions.json | 0 .../.vscode/launch.json | 0 .../.vscode/settings.json | 0 .../.vscode/tasks.json | 0 .../README.md | 6 +- .../poetry.toml | 0 .../pyproject.toml | 6 +- .../smart_contracts/README.md | 0 .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 0 .../smart_contracts/config.py | 0 .../smart_contracts/hello_world/contract.py | 0 .../hello_world/deploy_config.py | 0 .../smart_contracts/helpers/__init__.py | 0 .../smart_contracts/helpers/build.py | 0 .../smart_contracts/helpers/deploy.py | 0 .../tests/__init__.py | 0 .../tests/conftest.py | 0 .../tests/hello_world_test.py | 0 .../test_ide_vscode-False/.copier-answers.yml | 1 + .../test_ide_vscode-False/.gitignore | 6 +- .../test_ide_vscode-False/README.md | 4 +- .../test_ide_vscode-False/pyproject.toml | 4 +- .../test_ide_vscode-True/.copier-answers.yml | 1 + .../test_ide_vscode-True/.gitignore | 6 +- .../test_ide_vscode-True/README.md | 4 +- .../test_ide_vscode-True/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_preset_name-production/.gitignore | 6 +- .../test_preset_name-production/README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_preset_name-starter/.gitignore | 6 +- .../test_preset_name-starter/README.md | 4 +- .../test_preset_name-starter/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_python_linter-flake8/.gitignore | 6 +- .../test_python_linter-flake8/README.md | 4 +- .../test_python_linter-flake8/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_python_linter-none/.gitignore | 6 +- .../test_python_linter-none/README.md | 4 +- .../test_python_linter-none/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_python_linter-ruff/.gitignore | 6 +- .../test_python_linter-ruff/README.md | 4 +- .../test_python_linter-ruff/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../.gitignore | 6 +- .../README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../.gitignore | 6 +- .../README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../.gitignore | 6 +- .../README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../.gitignore | 6 +- .../README.md | 4 +- .../pyproject.toml | 4 +- .../test_use_dispenser-False/README.md | 57 ---- .../test_use_dispenser-False/pyproject.toml | 26 -- .../test_use_dispenser-True/.algokit.toml | 16 - .../.copier-answers.yml | 25 -- .../test_use_dispenser-True/README.md | 57 ---- .../.copier-answers.yml | 1 + .../test_use_github_actions-False/.gitignore | 6 +- .../test_use_github_actions-False/README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_use_github_actions-True/.gitignore | 6 +- .../test_use_github_actions-True/README.md | 4 +- .../pyproject.toml | 4 +- .../test_use_pre_commit-False/.editorconfig | 10 - .../.env.localnet.template | 7 - .../test_use_pre_commit-False/.env.template | 1 - .../.env.testnet.template | 3 - .../test_use_pre_commit-False/.gitattributes | 1 - .../test_use_pre_commit-False/.gitignore | 172 ---------- .../.vscode/extensions.json | 7 - .../.vscode/launch.json | 31 -- .../.vscode/settings.json | 32 -- .../.vscode/tasks.json | 64 ---- .../test_use_pre_commit-False/poetry.toml | 2 - .../smart_contracts/README.md | 9 - .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 46 --- .../smart_contracts/config.py | 64 ---- .../smart_contracts/hello_world/contract.py | 10 - .../hello_world/deploy_config.py | 36 -- .../smart_contracts/helpers/__init__.py | 0 .../smart_contracts/helpers/build.py | 43 --- .../smart_contracts/helpers/deploy.py | 50 --- .../tests/__init__.py | 0 .../tests/conftest.py | 25 -- .../tests/hello_world_test.py | 33 -- .../test_use_pre_commit-True/.algokit.toml | 15 - .../.copier-answers.yml | 25 -- .../test_use_pre_commit-True/.editorconfig | 10 - .../.env.localnet.template | 7 - .../test_use_pre_commit-True/.env.template | 1 - .../.env.testnet.template | 3 - .../test_use_pre_commit-True/.gitattributes | 1 - .../test_use_pre_commit-True/.gitignore | 172 ---------- .../.pre-commit-config.yaml | 15 - .../.vscode/extensions.json | 7 - .../.vscode/launch.json | 31 -- .../.vscode/settings.json | 32 -- .../.vscode/tasks.json | 64 ---- .../test_use_pre_commit-True/README.md | 58 ---- .../test_use_pre_commit-True/poetry.toml | 2 - .../test_use_pre_commit-True/pyproject.toml | 27 -- .../smart_contracts/README.md | 9 - .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 46 --- .../smart_contracts/config.py | 64 ---- .../smart_contracts/hello_world/contract.py | 10 - .../hello_world/deploy_config.py | 36 -- .../smart_contracts/helpers/__init__.py | 0 .../smart_contracts/helpers/build.py | 43 --- .../smart_contracts/helpers/deploy.py | 50 --- .../tests/__init__.py | 0 .../tests/conftest.py | 25 -- .../tests/hello_world_test.py | 33 -- .../.copier-answers.yml | 1 + .../test_use_python_black-False/.gitignore | 6 +- .../test_use_python_black-False/README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_use_python_black-True/.gitignore | 6 +- .../test_use_python_black-True/README.md | 4 +- .../test_use_python_black-True/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_use_python_mypy-False/.gitignore | 6 +- .../test_use_python_mypy-False/README.md | 4 +- .../test_use_python_mypy-False/pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_use_python_mypy-True/.gitignore | 6 +- .../test_use_python_mypy-True/README.md | 4 +- .../test_use_python_mypy-True/pyproject.toml | 4 +- .../.algokit.toml | 15 - .../.copier-answers.yml | 25 -- .../.editorconfig | 10 - .../.env.localnet.template | 7 - .../.env.template | 1 - .../.env.testnet.template | 3 - .../.gitattributes | 1 - .../.gitignore | 172 ---------- .../.vscode/extensions.json | 7 - .../.vscode/launch.json | 31 -- .../.vscode/settings.json | 32 -- .../.vscode/tasks.json | 64 ---- .../test_use_python_pip_audit-False/README.md | 56 ---- .../poetry.toml | 2 - .../pyproject.toml | 25 -- .../smart_contracts/README.md | 9 - .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 46 --- .../smart_contracts/config.py | 64 ---- .../smart_contracts/hello_world/contract.py | 10 - .../hello_world/deploy_config.py | 36 -- .../smart_contracts/helpers/__init__.py | 0 .../smart_contracts/helpers/build.py | 43 --- .../smart_contracts/helpers/deploy.py | 50 --- .../tests/__init__.py | 0 .../tests/conftest.py | 25 -- .../tests/hello_world_test.py | 33 -- .../.algokit.toml | 15 - .../.copier-answers.yml | 25 -- .../.editorconfig | 10 - .../.env.localnet.template | 7 - .../.env.template | 1 - .../.env.testnet.template | 3 - .../.gitattributes | 1 - .../test_use_python_pip_audit-True/.gitignore | 172 ---------- .../.vscode/extensions.json | 7 - .../.vscode/launch.json | 31 -- .../.vscode/settings.json | 32 -- .../.vscode/tasks.json | 64 ---- .../poetry.toml | 2 - .../pyproject.toml | 26 -- .../smart_contracts/README.md | 9 - .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 46 --- .../smart_contracts/config.py | 64 ---- .../smart_contracts/hello_world/contract.py | 10 - .../hello_world/deploy_config.py | 36 -- .../smart_contracts/helpers/__init__.py | 0 .../smart_contracts/helpers/build.py | 43 --- .../smart_contracts/helpers/deploy.py | 50 --- .../tests/__init__.py | 0 .../tests/conftest.py | 25 -- .../tests/hello_world_test.py | 33 -- .../.copier-answers.yml | 1 + .../test_use_python_pytest-False/.gitignore | 6 +- .../test_use_python_pytest-False/README.md | 4 +- .../pyproject.toml | 4 +- .../.copier-answers.yml | 1 + .../test_use_python_pytest-True/.gitignore | 6 +- .../test_use_python_pytest-True/README.md | 4 +- .../pyproject.toml | 4 +- 278 files changed, 884 insertions(+), 3459 deletions(-) create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/externalDependencies.xml create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application.xml.jinja create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application____LocalNet.xml.jinja create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Reset_AlgoKit_LocalNet.xml create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Start_AlgoKit_LocalNet.xml create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Stop_AlgoKit_LocalNet.xml create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja create mode 100644 template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.algokit.toml (100%) rename tests_generated/{test_use_pre_commit-False => test_ide_jetbrains-False}/.copier-answers.yml (91%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.editorconfig (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.env.localnet.template (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.env.template (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.env.testnet.template (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.gitattributes (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-False}/.gitignore (98%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.vscode/extensions.json (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.vscode/launch.json (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.vscode/settings.json (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/.vscode/tasks.json (100%) rename tests_generated/{test_use_python_pip_audit-True => test_ide_jetbrains-False}/README.md (88%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/poetry.toml (100%) rename tests_generated/{test_use_pre_commit-False => test_ide_jetbrains-False}/pyproject.toml (84%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/README.md (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/__init__.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/__main__.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/config.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/hello_world/contract.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/hello_world/deploy_config.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/helpers/__init__.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/helpers/build.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/smart_contracts/helpers/deploy.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/tests/__init__.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/tests/conftest.py (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-False}/tests/hello_world_test.py (100%) rename tests_generated/{test_use_pre_commit-False => test_ide_jetbrains-True}/.algokit.toml (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-True}/.copier-answers.yml (92%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.editorconfig (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.env.localnet.template (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.env.template (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.env.testnet.template (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.gitattributes (100%) rename tests_generated/{test_use_dispenser-False => test_ide_jetbrains-True}/.gitignore (98%) create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Build_Beaker_application.xml create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Build_Beaker_application____LocalNet.xml create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Build___Deploy_Beaker_application.xml create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Deploy_Built_Beaker_application.xml create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Reset_AlgoKit_LocalNet.xml create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Start_AlgoKit_LocalNet.xml create mode 100644 tests_generated/test_ide_jetbrains-True/.idea/runConfigurations/Stop_AlgoKit_LocalNet.xml rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.vscode/extensions.json (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.vscode/launch.json (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.vscode/settings.json (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/.vscode/tasks.json (100%) rename tests_generated/{test_use_pre_commit-False => test_ide_jetbrains-True}/README.md (88%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/poetry.toml (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/pyproject.toml (84%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/README.md (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/__init__.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/__main__.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/config.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/hello_world/contract.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/hello_world/deploy_config.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/helpers/__init__.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/helpers/build.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/smart_contracts/helpers/deploy.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/tests/__init__.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/tests/conftest.py (100%) rename tests_generated/{test_use_dispenser-True => test_ide_jetbrains-True}/tests/hello_world_test.py (100%) delete mode 100644 tests_generated/test_use_dispenser-False/README.md delete mode 100644 tests_generated/test_use_dispenser-False/pyproject.toml delete mode 100644 tests_generated/test_use_dispenser-True/.algokit.toml delete mode 100644 tests_generated/test_use_dispenser-True/.copier-answers.yml delete mode 100644 tests_generated/test_use_dispenser-True/README.md delete mode 100644 tests_generated/test_use_pre_commit-False/.editorconfig delete mode 100644 tests_generated/test_use_pre_commit-False/.env.localnet.template delete mode 100644 tests_generated/test_use_pre_commit-False/.env.template delete mode 100644 tests_generated/test_use_pre_commit-False/.env.testnet.template delete mode 100644 tests_generated/test_use_pre_commit-False/.gitattributes delete mode 100644 tests_generated/test_use_pre_commit-False/.gitignore delete mode 100644 tests_generated/test_use_pre_commit-False/.vscode/extensions.json delete mode 100644 tests_generated/test_use_pre_commit-False/.vscode/launch.json delete mode 100644 tests_generated/test_use_pre_commit-False/.vscode/settings.json delete mode 100644 tests_generated/test_use_pre_commit-False/.vscode/tasks.json delete mode 100644 tests_generated/test_use_pre_commit-False/poetry.toml delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/README.md delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/__init__.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/__main__.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/config.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/hello_world/contract.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/hello_world/deploy_config.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/helpers/__init__.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/helpers/build.py delete mode 100644 tests_generated/test_use_pre_commit-False/smart_contracts/helpers/deploy.py delete mode 100644 tests_generated/test_use_pre_commit-False/tests/__init__.py delete mode 100644 tests_generated/test_use_pre_commit-False/tests/conftest.py delete mode 100644 tests_generated/test_use_pre_commit-False/tests/hello_world_test.py delete mode 100644 tests_generated/test_use_pre_commit-True/.algokit.toml delete mode 100644 tests_generated/test_use_pre_commit-True/.copier-answers.yml delete mode 100644 tests_generated/test_use_pre_commit-True/.editorconfig delete mode 100644 tests_generated/test_use_pre_commit-True/.env.localnet.template delete mode 100644 tests_generated/test_use_pre_commit-True/.env.template delete mode 100644 tests_generated/test_use_pre_commit-True/.env.testnet.template delete mode 100644 tests_generated/test_use_pre_commit-True/.gitattributes delete mode 100644 tests_generated/test_use_pre_commit-True/.gitignore delete mode 100644 tests_generated/test_use_pre_commit-True/.pre-commit-config.yaml delete mode 100644 tests_generated/test_use_pre_commit-True/.vscode/extensions.json delete mode 100644 tests_generated/test_use_pre_commit-True/.vscode/launch.json delete mode 100644 tests_generated/test_use_pre_commit-True/.vscode/settings.json delete mode 100644 tests_generated/test_use_pre_commit-True/.vscode/tasks.json delete mode 100644 tests_generated/test_use_pre_commit-True/README.md delete mode 100644 tests_generated/test_use_pre_commit-True/poetry.toml delete mode 100644 tests_generated/test_use_pre_commit-True/pyproject.toml delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/README.md delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/__init__.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/__main__.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/config.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/hello_world/contract.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/hello_world/deploy_config.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/helpers/__init__.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/helpers/build.py delete mode 100644 tests_generated/test_use_pre_commit-True/smart_contracts/helpers/deploy.py delete mode 100644 tests_generated/test_use_pre_commit-True/tests/__init__.py delete mode 100644 tests_generated/test_use_pre_commit-True/tests/conftest.py delete mode 100644 tests_generated/test_use_pre_commit-True/tests/hello_world_test.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/.algokit.toml delete mode 100644 tests_generated/test_use_python_pip_audit-False/.copier-answers.yml delete mode 100644 tests_generated/test_use_python_pip_audit-False/.editorconfig delete mode 100644 tests_generated/test_use_python_pip_audit-False/.env.localnet.template delete mode 100644 tests_generated/test_use_python_pip_audit-False/.env.template delete mode 100644 tests_generated/test_use_python_pip_audit-False/.env.testnet.template delete mode 100644 tests_generated/test_use_python_pip_audit-False/.gitattributes delete mode 100644 tests_generated/test_use_python_pip_audit-False/.gitignore delete mode 100644 tests_generated/test_use_python_pip_audit-False/.vscode/extensions.json delete mode 100644 tests_generated/test_use_python_pip_audit-False/.vscode/launch.json delete mode 100644 tests_generated/test_use_python_pip_audit-False/.vscode/settings.json delete mode 100644 tests_generated/test_use_python_pip_audit-False/.vscode/tasks.json delete mode 100644 tests_generated/test_use_python_pip_audit-False/README.md delete mode 100644 tests_generated/test_use_python_pip_audit-False/poetry.toml delete mode 100644 tests_generated/test_use_python_pip_audit-False/pyproject.toml delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/README.md delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/__init__.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/__main__.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/config.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/hello_world/contract.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/hello_world/deploy_config.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/helpers/__init__.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/helpers/build.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/smart_contracts/helpers/deploy.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/tests/__init__.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/tests/conftest.py delete mode 100644 tests_generated/test_use_python_pip_audit-False/tests/hello_world_test.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/.algokit.toml delete mode 100644 tests_generated/test_use_python_pip_audit-True/.copier-answers.yml delete mode 100644 tests_generated/test_use_python_pip_audit-True/.editorconfig delete mode 100644 tests_generated/test_use_python_pip_audit-True/.env.localnet.template delete mode 100644 tests_generated/test_use_python_pip_audit-True/.env.template delete mode 100644 tests_generated/test_use_python_pip_audit-True/.env.testnet.template delete mode 100644 tests_generated/test_use_python_pip_audit-True/.gitattributes delete mode 100644 tests_generated/test_use_python_pip_audit-True/.gitignore delete mode 100644 tests_generated/test_use_python_pip_audit-True/.vscode/extensions.json delete mode 100644 tests_generated/test_use_python_pip_audit-True/.vscode/launch.json delete mode 100644 tests_generated/test_use_python_pip_audit-True/.vscode/settings.json delete mode 100644 tests_generated/test_use_python_pip_audit-True/.vscode/tasks.json delete mode 100644 tests_generated/test_use_python_pip_audit-True/poetry.toml delete mode 100644 tests_generated/test_use_python_pip_audit-True/pyproject.toml delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/README.md delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/__init__.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/__main__.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/config.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/hello_world/contract.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/hello_world/deploy_config.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/helpers/__init__.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/helpers/build.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/smart_contracts/helpers/deploy.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/tests/__init__.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/tests/conftest.py delete mode 100644 tests_generated/test_use_python_pip_audit-True/tests/hello_world_test.py diff --git a/.gitattributes b/.gitattributes index 7d07d70c..6313b56c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -* text=lf +* text=auto eol=lf diff --git a/.github/workflows/check-python.yaml b/.github/workflows/check-python.yaml index 4d31c950..4958c23c 100644 --- a/.github/workflows/check-python.yaml +++ b/.github/workflows/check-python.yaml @@ -45,7 +45,7 @@ jobs: shell: bash run: | set -o pipefail - poetry run pytest --junitxml=pytest-junit.xml + poetry run pytest --junitxml=pytest-junit.xml -n auto - name: Check generated templates have been reviewed shell: bash diff --git a/.gitignore b/.gitignore index 426dfccb..5d337899 100644 --- a/.gitignore +++ b/.gitignore @@ -156,8 +156,10 @@ dmypy.json cython_debug/ # PyCharm -.idea/ -!.idea/runConfigurations +.idea +!.idea/ +.idea/* +!.idea/runConfigurations/ # macOS .DS_Store diff --git a/copier.yaml b/copier.yaml index d11af106..2ccf0859 100644 --- a/copier.yaml +++ b/copier.yaml @@ -1,152 +1,158 @@ -_subdirectory: template_content -_templates_suffix: ".jinja" - -# questions -# project_name should never get prompted, AlgoKit should always pass it by convention -project_name: - type: str - help: Name for this project. - placeholder: "algorand-app" - -preset_name: - type: str - help: Name of the preset to use. Starter is optimal for simpler projects, Production is optimal for more complex projects that require CI/CD and other features. - choices: - Starter: "starter" - Production: "production" - default: "starter" - -contract_name: - type: str - help: Name of the default smart contract app. - placeholder: "hello_world" - default: "hello_world" - validator: >- - {% if not (contract_name | regex_search('^[a-z]+(?:_[a-z]+)*$')) %} - contract_name must be formatted in snake case. - {% endif %} - -author_name: - type: str - help: Package author name - placeholder: "Your Name" - -author_email: - type: str - help: Package author email - placeholder: "your@email.tld" - -ide_vscode: - type: bool - help: Do you want to add VSCode configuration? - default: yes - -deployment_language: - type: str - help: What programming language do you want to use for your contract deployment code? - choices: - Python: "python" - TypeScript: "typescript" - default: "python" - -python_linter: - type: str - help: Do you want to use a Python linter? - when: "{{ preset_name == 'production' }}" - choices: - Ruff: "ruff" - Flake8: "flake8" - No thanks: "none" - default: |- - {% if preset_name == 'production' -%} - ruff - {%- else -%} - none - {%- endif %} - -use_python_black: - type: bool - help: Do you want to use a Python formatter (via Black)? - default: yes - -use_python_mypy: - type: bool - when: "{{ preset_name == 'production' }}" - help: Do you want to use a Python type checker (via mypy)? - default: |- - {% if preset_name == 'production' -%} - yes - {%- else -%} - no - {%- endif %} - -use_python_pytest: - type: bool - help: Do you want to include unit tests (via pytest)? - default: yes - -use_python_pip_audit: - type: bool - when: "{{ preset_name == 'production' }}" - help: Do you want to include Python dependency vulnerability scanning (via pip-audit)? - default: yes - -use_github_actions: - type: bool - when: "{{ preset_name == 'production' }}" - help: Do you want to include Github Actions workflows for build and testnet deployment? - default: |- - {% if preset_name == 'production' -%} - yes - {%- else -%} - no - {%- endif %} - -use_pre_commit: - type: bool - when: "{{ preset_name == 'production' }}" - help: Do you want to include pre-commit for linting, type checking and formatting? - default: |- - {% if preset_name == 'production' -%} - yes - {%- else -%} - no - {%- endif %} - -use_dispenser: - type: bool - when: "{{ preset_name == 'production' }}" - help: Do you want to fund your deployment account using an optional dispenser account? - default: no - -# The following should never get prompted; algokit should always pass these values through by convention - -algod_token: - type: str - help: Default Algod Token - default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - -algod_server: - type: str - help: Default Algod server - default: "http://localhost" - -algod_port: - type: int - help: Default Algod port - default: 4001 - -indexer_token: - type: str - help: Default Indexer token - default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - -indexer_server: - type: str - help: Default Indexer server - default: "http://localhost" - -indexer_port: - type: int - help: Default Indexer port - default: 8980 +_subdirectory: template_content +_templates_suffix: ".jinja" + +# questions +# project_name should never get prompted, AlgoKit should always pass it by convention +project_name: + type: str + help: Name for this project. + placeholder: "algorand-app" + +preset_name: + type: str + help: Name of the preset to use. Starter is optimal for simpler projects, Production is optimal for more complex projects that require CI/CD and other features. + choices: + Starter: "starter" + Production: "production" + default: "starter" + +contract_name: + type: str + help: Name of the default smart contract app. + placeholder: "hello_world" + default: "hello_world" + validator: >- + {% if not (contract_name | regex_search('^[a-z]+(?:_[a-z]+)*$')) %} + contract_name must be formatted in snake case. + {% endif %} + +author_name: + type: str + help: Package author name + placeholder: "Your Name" + +author_email: + type: str + help: Package author email + placeholder: "your@email.tld" + +ide_vscode: + type: bool + help: Do you want to add VSCode configuration? + default: yes + +ide_jetbrains: + type: bool + help: Do you want to add JetBrains configuration (primarily optimized for PyCharm CE)? + when: "{{ ide_vscode == false }}" + default: no + +deployment_language: + type: str + help: What programming language do you want to use for your contract deployment code? + choices: + Python: "python" + TypeScript: "typescript" + default: "python" + +python_linter: + type: str + help: Do you want to use a Python linter? + when: "{{ preset_name == 'production' }}" + choices: + Ruff: "ruff" + Flake8: "flake8" + No thanks: "none" + default: |- + {% if preset_name == 'production' -%} + ruff + {%- else -%} + none + {%- endif %} + +use_python_black: + type: bool + help: Do you want to use a Python formatter (via Black)? + default: yes + +use_python_mypy: + type: bool + when: "{{ preset_name == 'production' }}" + help: Do you want to use a Python type checker (via mypy)? + default: |- + {% if preset_name == 'production' -%} + yes + {%- else -%} + no + {%- endif %} + +use_python_pytest: + type: bool + help: Do you want to include unit tests (via pytest)? + default: yes + +use_python_pip_audit: + type: bool + when: "{{ preset_name == 'production' }}" + help: Do you want to include Python dependency vulnerability scanning (via pip-audit)? + default: yes + +use_github_actions: + type: bool + when: "{{ preset_name == 'production' }}" + help: Do you want to include Github Actions workflows for build and testnet deployment? + default: |- + {% if preset_name == 'production' -%} + yes + {%- else -%} + no + {%- endif %} + +use_pre_commit: + type: bool + when: "{{ preset_name == 'production' }}" + help: Do you want to include pre-commit for linting, type checking and formatting? + default: |- + {% if preset_name == 'production' -%} + yes + {%- else -%} + no + {%- endif %} + +use_dispenser: + type: bool + when: "{{ preset_name == 'production' }}" + help: Do you want to fund your deployment account using an optional dispenser account? + default: no + +# The following should never get prompted; algokit should always pass these values through by convention + +algod_token: + type: str + help: Default Algod Token + default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +algod_server: + type: str + help: Default Algod server + default: "http://localhost" + +algod_port: + type: int + help: Default Algod port + default: 4001 + +indexer_token: + type: str + help: Default Indexer token + default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +indexer_server: + type: str + help: Default Indexer server + default: "http://localhost" + +indexer_port: + type: int + help: Default Indexer port + default: 8980 diff --git a/poetry.lock b/poetry.lock index 6b370242..c52a408d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiohttp" version = "3.8.4" description = "Async http client/server framework (asyncio)" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -113,7 +112,6 @@ speedups = ["Brotli", "aiodns", "cchardet"] name = "aiosignal" version = "1.3.1" description = "aiosignal: a list of registered asynchronous callbacks" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -128,7 +126,6 @@ frozenlist = ">=1.1.0" name = "algokit-utils" version = "1.3.0" description = "Utilities for Algorand development for use by AlgoKit" -category = "main" optional = false python-versions = ">=3.10,<4.0" files = [ @@ -142,7 +139,6 @@ py-algorand-sdk = ">=2.2.0,<3.0.0" name = "async-timeout" version = "4.0.2" description = "Timeout context manager for asyncio programs" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -154,7 +150,6 @@ files = [ name = "attrs" version = "23.1.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -173,7 +168,6 @@ tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pyte name = "beaker-pyteal" version = "1.0.1" description = "A Framework for building PyTeal Applications" -category = "main" optional = false python-versions = ">=3.10,<4.0" files = [ @@ -189,7 +183,6 @@ pyteal = ">=0.24,<0.25" name = "black" version = "22.12.0" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -225,7 +218,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = "*" files = [ @@ -302,7 +294,6 @@ pycparser = "*" name = "cfgv" version = "3.3.1" description = "Validate configuration and produce human readable error messages." -category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -314,7 +305,6 @@ files = [ name = "charset-normalizer" version = "3.1.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -399,7 +389,6 @@ files = [ name = "click" version = "8.1.3" description = "Composable command line interface toolkit" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -414,7 +403,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -426,7 +414,6 @@ files = [ name = "distlib" version = "0.3.6" description = "Distribution utilities" -category = "dev" optional = false python-versions = "*" files = [ @@ -438,7 +425,6 @@ files = [ name = "docstring-parser" version = "0.14.1" description = "Parse Python docstrings in reST, Google and Numpydoc format" -category = "main" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -450,7 +436,6 @@ files = [ name = "exceptiongroup" version = "1.1.1" description = "Backport of PEP 654 (exception groups)" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -461,11 +446,24 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "execnet" +version = "2.0.2" +description = "execnet: rapid multi-Python deployment" +optional = false +python-versions = ">=3.7" +files = [ + {file = "execnet-2.0.2-py3-none-any.whl", hash = "sha256:88256416ae766bc9e8895c76a87928c0012183da3cc4fc18016e6f050e025f41"}, + {file = "execnet-2.0.2.tar.gz", hash = "sha256:cc59bc4423742fd71ad227122eb0dd44db51efb3dc4095b45ac9a08c770096af"}, +] + +[package.extras] +testing = ["hatch", "pre-commit", "pytest", "tox"] + [[package]] name = "executing" version = "1.2.0" description = "Get the currently executing AST node of a frame, and other information" -category = "main" optional = false python-versions = "*" files = [ @@ -480,7 +478,6 @@ tests = ["asttokens", "littleutils", "pytest", "rich"] name = "filelock" version = "3.12.2" description = "A platform independent file lock." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -496,7 +493,6 @@ testing = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "diff-cover (>=7.5)", "p name = "flake8" version = "6.0.0" description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" optional = false python-versions = ">=3.8.1" files = [ @@ -513,7 +509,6 @@ pyflakes = ">=3.0.0,<3.1.0" name = "frozenlist" version = "1.3.3" description = "A list-like structure which implements collections.abc.MutableSequence" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -597,7 +592,6 @@ files = [ name = "identify" version = "2.5.24" description = "File identification library for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -612,7 +606,6 @@ license = ["ukkonen"] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -624,7 +617,6 @@ files = [ name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -636,7 +628,6 @@ files = [ name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -648,7 +639,6 @@ files = [ name = "msgpack" version = "1.0.5" description = "MessagePack serializer" -category = "main" optional = false python-versions = "*" files = [ @@ -721,7 +711,6 @@ files = [ name = "multidict" version = "6.0.4" description = "multidict implementation" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -805,7 +794,6 @@ files = [ name = "mypy" version = "1.4.0" description = "Optional static typing for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -852,7 +840,6 @@ reports = ["lxml"] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -864,7 +851,6 @@ files = [ name = "nodeenv" version = "1.8.0" description = "Node.js virtual environment builder" -category = "dev" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ @@ -879,7 +865,6 @@ setuptools = "*" name = "packaging" version = "23.1" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -891,7 +876,6 @@ files = [ name = "pathspec" version = "0.11.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -903,7 +887,6 @@ files = [ name = "platformdirs" version = "3.6.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -919,7 +902,6 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest- name = "pluggy" version = "1.0.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -935,7 +917,6 @@ testing = ["pytest", "pytest-benchmark"] name = "pre-commit" version = "3.3.3" description = "A framework for managing and maintaining multi-language pre-commit hooks." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -954,7 +935,6 @@ virtualenv = ">=20.10.0" name = "py-algorand-sdk" version = "2.3.0" description = "Algorand SDK in Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -971,7 +951,6 @@ pynacl = ">=1.4.0,<2" name = "pycodestyle" version = "2.10.0" description = "Python style guide checker" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -983,7 +962,6 @@ files = [ name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -995,7 +973,6 @@ files = [ name = "pycryptodomex" version = "3.18.0" description = "Cryptographic library for Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -1037,7 +1014,6 @@ files = [ name = "pyflakes" version = "3.0.1" description = "passive checker of Python programs" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1049,7 +1025,6 @@ files = [ name = "pynacl" version = "1.5.0" description = "Python binding to the Networking and Cryptography (NaCl) library" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1076,7 +1051,6 @@ tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] name = "pyteal" version = "0.24.1" description = "Algorand Smart Contracts in Python" -category = "main" optional = false python-versions = ">=3.10" files = [ @@ -1095,7 +1069,6 @@ tabulate = ">=0.9.0,<0.10.0" name = "pytest" version = "7.3.2" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1114,11 +1087,30 @@ tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-xdist" +version = "3.3.1" +description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-xdist-3.3.1.tar.gz", hash = "sha256:d5ee0520eb1b7bcca50a60a518ab7a7707992812c578198f8b44fdfac78e8c93"}, + {file = "pytest_xdist-3.3.1-py3-none-any.whl", hash = "sha256:ff9daa7793569e6a68544850fd3927cd257cc03a7ef76c95e86915355e82b5f2"}, +] + +[package.dependencies] +execnet = ">=1.1" +pytest = ">=6.2.0" + +[package.extras] +psutil = ["psutil (>=3.0)"] +setproctitle = ["setproctitle"] +testing = ["filelock"] + [[package]] name = "python-dotenv" version = "1.0.0" description = "Read key-value pairs from a .env file and set them as environment variables" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1133,7 +1125,6 @@ cli = ["click (>=5.0)"] name = "pyyaml" version = "6.0" description = "YAML parser and emitter for Python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1183,7 +1174,6 @@ files = [ name = "ruff" version = "0.0.273" description = "An extremely fast Python linter, written in Rust." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1210,7 +1200,6 @@ files = [ name = "semantic-version" version = "2.10.0" description = "A library implementing the 'SemVer' scheme." -category = "main" optional = false python-versions = ">=2.7" files = [ @@ -1226,7 +1215,6 @@ doc = ["Sphinx", "sphinx-rtd-theme"] name = "setuptools" version = "68.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1243,7 +1231,6 @@ testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs ( name = "tabulate" version = "0.9.0" description = "Pretty-print tabular data" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1258,7 +1245,6 @@ widechars = ["wcwidth"] name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1270,7 +1256,6 @@ files = [ name = "types-pyyaml" version = "6.0.12.10" description = "Typing stubs for PyYAML" -category = "dev" optional = false python-versions = "*" files = [ @@ -1282,7 +1267,6 @@ files = [ name = "typing-extensions" version = "4.6.3" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1294,7 +1278,6 @@ files = [ name = "virtualenv" version = "20.23.1" description = "Virtual Python Environment builder" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1315,7 +1298,6 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess name = "yarl" version = "1.9.2" description = "Yet another URL library" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1402,4 +1384,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "2a74fb8a61a445a98517edd4fb697cec6b61a9a0c4b10853dadfa7d433640ba3" +content-hash = "464c52c347db4dc0d66c2b549410f605b124addd80c30234dae6caed12881d93" diff --git a/pyproject.toml b/pyproject.toml index 7a6ad356..7551f236 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ pytest = "^7.2.2" mypy = "^1.1.1" pre-commit = "^3.2.1" types-pyyaml = "^6.0.12.9" +pytest-xdist = "^3.3.1" [build-system] requires = ["poetry-core"] diff --git a/template_content/.gitignore.jinja b/template_content/.gitignore.jinja index 0dbe8edb..832924c3 100644 --- a/template_content/.gitignore.jinja +++ b/template_content/.gitignore.jinja @@ -159,8 +159,10 @@ dmypy.json cython_debug/ # PyCharm -.idea/ -!.idea/runConfigurations +.idea +!.idea/ +.idea/* +!.idea/runConfigurations/ # macOS .DS_Store diff --git a/template_content/README.md.jinja b/template_content/README.md.jinja index 83dac749..7c92ff0e 100644 --- a/template_content/README.md.jinja +++ b/template_content/README.md.jinja @@ -28,10 +28,10 @@ This project has been generated using AlgoKit. See below for default getting sta 1. Open the command palette (Ctrl/Cmd + Shift + P) 2. Search for `Python: Select Interpreter` 3. Select `./.venv/Scripts/python.exe` - - IDEA (e.g. PyCharm) + - JetBrains IDEs (please note, this setup is primarily optimized for PyCharm Community Edition) 1. Open the repository root in the IDE 2. It should automatically detect it's a Poetry project and set up a Python interpreter and virtual environment. - 3. Hit Shift+F9 (or whatever you have debug mapped to) and it should start running with breakpoint debugging. + 3. Hit Shift+F10|Ctrl+R (or whatever you have debug mapped to) and it should start running with breakpoint debugging. Please note, JetBrains IDEs on Windows have a known bug that in some cases may prevent executing shell scripts as pre-launch tasks, for workarounds refer to [JetBrains forums](https://youtrack.jetbrains.com/issue/IDEA-277486/Shell-script-configuration-cannot-run-as-before-launch-task). - Other 1. Open the repository root in your text editor of choice 2. In a terminal run `poetry shell` diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index dd02d619..998870b3 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -7,8 +7,8 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" -beaker-pyteal = "^1.0.0" -algokit-utils = "^1.3" +beaker-pyteal = "^1.1.1" +algokit-utils = "^2.0.1" python-dotenv = "^1.0.0" [tool.poetry.group.dev.dependencies] diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/externalDependencies.xml b/template_content/{% if ide_jetbrains %}.idea{% endif %}/externalDependencies.xml new file mode 100644 index 00000000..03ecbed8 --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/externalDependencies.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application.xml.jinja b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application.xml.jinja new file mode 100644 index 00000000..d4b88412 --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application.xml.jinja @@ -0,0 +1,35 @@ + + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application____LocalNet.xml.jinja b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application____LocalNet.xml.jinja new file mode 100644 index 00000000..a2b0f2ac --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Build_Beaker_application____LocalNet.xml.jinja @@ -0,0 +1,37 @@ + + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Reset_AlgoKit_LocalNet.xml b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Reset_AlgoKit_LocalNet.xml new file mode 100644 index 00000000..7f1236a4 --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Reset_AlgoKit_LocalNet.xml @@ -0,0 +1,17 @@ + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Start_AlgoKit_LocalNet.xml b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Start_AlgoKit_LocalNet.xml new file mode 100644 index 00000000..f699a7ac --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Start_AlgoKit_LocalNet.xml @@ -0,0 +1,17 @@ + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Stop_AlgoKit_LocalNet.xml b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Stop_AlgoKit_LocalNet.xml new file mode 100644 index 00000000..e510cbce --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/Stop_AlgoKit_LocalNet.xml @@ -0,0 +1,17 @@ + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja new file mode 100644 index 00000000..ad46e786 --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja @@ -0,0 +1,38 @@ + + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja new file mode 100644 index 00000000..ac77102c --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'python' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja @@ -0,0 +1,36 @@ + + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja new file mode 100644 index 00000000..44d3796e --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Build___Deploy_Beaker_application.xml{% endif %}.jinja @@ -0,0 +1,18 @@ + + + + diff --git a/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja new file mode 100644 index 00000000..b8842d94 --- /dev/null +++ b/template_content/{% if ide_jetbrains %}.idea{% endif %}/runConfigurations/{% if deployment_language == 'typescript' %}Deploy_Built_Beaker_application.xml{% endif %}.jinja @@ -0,0 +1,16 @@ + + + + diff --git a/tests/test_templates.py b/tests/test_templates.py index 5d049da6..0771ec24 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -138,6 +138,22 @@ def run_init( # Remove .algokit generators folder to avoid polluting the git history shutil.rmtree(copy_to / ".algokit", ignore_errors=True) + # Check if .idea folder exists and if so modify os specific SDK_HOME path + idea_folder = copy_to / ".idea" + if idea_folder.exists(): + # Iterate over all files in .idea/runConfigurations + for file in (idea_folder / "runConfigurations").iterdir(): + # Read the file content + content = file.read_text() + # Replace the line containing SDK_HOME + content = re.sub( + r'