Skip to content

Commit d57afa8

Browse files
chore: warn user that poetry v1.x is not entirely compatible with AlgoKit (#670)
* fix: warn user that poetry v1.x is not entirely compatible with AlgoKit
1 parent a641175 commit d57afa8

File tree

86 files changed

+230
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+230
-10
lines changed

src/algokit/cli/project/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
import logging
2+
import re
3+
14
import click
25

36
from algokit.cli.project.bootstrap import bootstrap_group
47
from algokit.cli.project.deploy import deploy_command
58
from algokit.cli.project.link import link_command
69
from algokit.cli.project.list import list_command
710
from algokit.cli.project.run import run_group
11+
from algokit.core import proc
12+
13+
logger = logging.getLogger(__name__)
814

915

1016
@click.group(
@@ -14,6 +20,18 @@ def project_group() -> None:
1420
"""Provides a suite of commands for managing your AlgoKit project.
1521
This includes initializing project dependencies, deploying smart contracts,
1622
and executing predefined or custom commands within your project environment."""
23+
try:
24+
poetry_version_result = proc.run(
25+
["poetry", "--version"],
26+
)
27+
except Exception:
28+
return
29+
30+
if re.search(r"1\.\d+\.\d+", poetry_version_result.output):
31+
logger.warning(
32+
"You are using Poetry 1.x, which is deprecated. "
33+
"Please upgrade to Poetry 2.x for better support and features."
34+
)
1735

1836

1937
project_group.add_command(deploy_command)

tests/project/bootstrap/test_bootstrap.test_bootstrap_help.approved.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: Poetry (version 2.1.3)
13
Usage: algokit project bootstrap [OPTIONS] COMMAND [ARGS]...
24

35
Expedited initial setup for any developer by installing and configuring
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: Poetry (version 2.1.3)
13
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
24
Error: This template requires AlgoKit version 999.99.99 or higher, but you have AlgoKit version {current_version}. Please update AlgoKit.

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_algokit_min_version_ignore_error.approved.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: Poetry (version 2.1.3)
13
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
24
WARNING: This template requires AlgoKit version 999.99.99 or higher, but you have AlgoKit version {current_version}. Please update AlgoKit.
35
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_empty.approved.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: Poetry (version 2.1.3)
13
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
24
DEBUG: No .algokit.toml file found in the project directory.
35
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_env.approved.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: Poetry (version 2.1.3)
13
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
24
DEBUG: No .algokit.toml file found in the project directory.
35
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_npm[linux].approved.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: STDOUT
3+
DEBUG: poetry: STDERR
14
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
25
DEBUG: No .algokit.toml file found in the project directory.
36
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_npm[macOS].approved.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: STDOUT
3+
DEBUG: poetry: STDERR
14
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
25
DEBUG: No .algokit.toml file found in the project directory.
36
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_npm[windows].approved.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: STDOUT
3+
DEBUG: poetry: STDERR
14
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
25
DEBUG: No .algokit.toml file found in the project directory.
36
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

tests/project/bootstrap/test_bootstrap_all.test_bootstrap_all_poetry.approved.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
DEBUG: Running 'poetry --version' in '{current_working_directory}'
2+
DEBUG: poetry: STDOUT
3+
DEBUG: poetry: STDERR
14
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml
25
DEBUG: No .algokit.toml file found in the project directory.
36
DEBUG: Attempting to load project config from {current_working_directory}/.algokit.toml

0 commit comments

Comments
 (0)