Skip to content

Commit 40518a4

Browse files
lempiraneilcampbellaorumbayev
authored
chore: updated relevant to packages in order to update h11 (#634)
* chore: updated relevant to packages in order to update h11 * chore: updated tests * fix: unpick a bad localnet status test update * fix: adjust to latest copier answers object chore: pass combined answers to jinja render context * chore: added exception to httpx mocks and changed copier imports to _module fix: ruff format error * chore: updated algokit-utils to latest version from a beta testing version * chore: pinned copier version --------- Co-authored-by: Neil Campbell <neil.campbell@makerx.com.au> Co-authored-by: Altynbek Orumbayev <altynbek.orumbayev@makerx.com.au>
1 parent 0a61476 commit 40518a4

63 files changed

Lines changed: 955 additions & 912 deletions

File tree

Some content is hidden

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

poetry.lock

Lines changed: 777 additions & 754 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ readme = "README.md"
99
[tool.poetry.dependencies]
1010
python = ">=3.10,<3.14"
1111
click = "^8.1.3"
12-
httpx = "^0.23.1"
13-
copier = "^9.6.0"
12+
httpx = ">=0.23.1,<=0.28.1"
13+
copier = "9.7.1"
1414
questionary = "^1.10.0"
1515
pyclip = "^0.7.0"
1616
shellingham = "^1.5.4"
@@ -24,21 +24,21 @@ keyring = "25.2.1"
2424
# this version has been tested to work with the vendored file
2525
pyjwt = "^2.10.1"
2626
cryptography = "^44.0.2" # pyjwt has a weak dependency on cryptography and explicitly requires it in the vendored file, hence the lock
27-
algokit-utils = "^3.0.0"
27+
algokit-utils = "^4.0.1"
2828
multiformats = "0.3.1"
2929
multiformats_config = "0.3.1" # pinned this to be in lockstep with multiformats
3030
jsondiff = "^2.0.0"
3131
requests = "^2.31.0"
3232

3333
[tool.poetry.group.dev.dependencies]
3434
pyinstaller = {version = "^6.10.0"}
35-
pytest = "^7.2.0"
35+
pytest = "^8"
3636
ruff = ">=0.1.6,<0.5.0"
3737
pip-audit = "^2.4.7"
3838
approvaltests = "^7.2.0"
3939
pytest-mock = "^3.10.0"
4040
mypy = "^1.0.0"
41-
pytest-httpx = "^0.21.2"
41+
pytest-httpx = "^0.35.0"
4242
python-semantic-release = "^7.32.2"
4343
pytest-cov = "^4.0.0"
4444
pre-commit = ">=2.20,<4.0"

src/algokit/cli/init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def init_command( # noqa: PLR0913, C901, PLR0915
350350
# 2. the import fails if git is not installed (which we check above)
351351
# TODO: copier is typed, need to figure out how to force mypy to accept that or submit a PR
352352
# to their repo to include py.typed file
353-
from copier.main import Worker
353+
from copier._main import Worker
354354

355355
from algokit.core.init import populate_default_answers
356356

@@ -518,7 +518,7 @@ def _fail_and_bail() -> NoReturn:
518518

519519
def _repo_url_is_valid(url: str) -> bool:
520520
"""Check the repo URL is valid according to copier"""
521-
from copier.vcs import get_repo
521+
from copier._vcs import get_repo
522522

523523
if not url:
524524
return False
@@ -795,7 +795,7 @@ def _init_base_template(*, target_path: Path, is_blessed: bool) -> None:
795795
"projects_root_path": "projects",
796796
"include_github_workflow_template": not is_blessed,
797797
}
798-
from copier.main import Worker
798+
from copier._main import Worker
799799

800800
with Worker(
801801
src_path=base_template.url,

src/algokit/core/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def run_generator(answers: dict, path: Path) -> None:
4646
# copier is lazy imported for two reasons
4747
# 1. it is slow to import on first execution after installing
4848
# 2. the import fails if git is not installed (which we check above)
49-
from copier.main import Worker
49+
from copier._main import Worker
5050

5151
cwd = Path.cwd()
5252
expected_answers_file = cwd / ".algokit" / ".copier-answers.yml"

src/algokit/core/init.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
from pathlib import Path
66
from typing import Any, cast
77

8-
from copier.main import Worker
9-
from copier.types import MISSING
10-
from copier.user_data import AnswersMap, Question
8+
from copier._main import Worker
9+
from copier._types import MISSING
10+
from copier._user_data import AnswersMap, Question
1111

1212
from algokit.core.project import get_project_dir_names_from_workspace
1313

1414
logger = getLogger(__name__)
1515

16+
1617
DEFAULT_MIN_VERSION = "1.8.0"
1718
DEFAULT_PROJECTS_ROOT_PATH = "projects"
1819

@@ -37,6 +38,9 @@ def populate_default_answers(worker: Worker) -> None:
3738
answers=answers,
3839
jinja_env=worker.jinja_env,
3940
var_name=var_name,
41+
# https://github.com/copier-org/copier/releases/tag/v9.7.0 introduces changes to Question model,
42+
# which now requires passing context param.
43+
context={**worker._render_context(), **answers.combined}, # noqa: SLF001
4044
**details,
4145
)
4246
default_value = question.get_default()

src/algokit/core/proc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run( # noqa: PLR0913
6262
level=stdout_log_level,
6363
msg=(click.style(f"{command[0]}:", bold=True) if prefix_process else "") + f" {line.strip()}",
6464
)
65-
if exit_code == 0: # type: ignore[unreachable]
65+
if exit_code == 0:
6666
logger.debug(f"'{command_str}' completed successfully", extra=EXTRA_EXCLUDE_FROM_CONSOLE)
6767
else:
6868
logger.debug(f"'{command_str}' failed, exited with code = {exit_code}", extra=EXTRA_EXCLUDE_FROM_CONSOLE)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
DEBUG: HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
1+
HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
22
Successfully funded 1000000 μAlgo. Browse transaction at https://explore.algokit.io/testnet/transaction/dummy_tx_id
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
DEBUG: HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
1+
HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
22
Successfully funded 1000000 μAlgo. Browse transaction at https://explore.algokit.io/testnet/transaction/dummy_tx_id
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEBUG: Converted algos to microAlgos: 1000000
2-
DEBUG: HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
2+
HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
33
Successfully funded 1.0 Algo. Browse transaction at https://explore.algokit.io/testnet/transaction/dummy_tx_id
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEBUG: Using CI access token over keyring credentials
2-
DEBUG: HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
2+
HTTP Request: POST https://snapshottest.dispenser.com/fund/0 "HTTP/1.1 200 OK"
33
Successfully funded 1000000 μAlgo. Browse transaction at https://explore.algokit.io/testnet/transaction/dummy_tx_id

0 commit comments

Comments
 (0)