launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29032
[Merge] ~jugmac00/lpcraft:upgrade-dependencies into lpcraft:main
Jürgen Gmach has proposed merging ~jugmac00/lpcraft:upgrade-dependencies into lpcraft:main.
Commit message:
Upgrade dependencies
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jugmac00/lpcraft/+git/lpcraft/+merge/428647
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/lpcraft:upgrade-dependencies into lpcraft:main.
diff --git a/NEWS.rst b/NEWS.rst
index 0823874..f159d6f 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -5,7 +5,8 @@ Version history
0.0.28 (unreleased)
===================
-- Nothing yet.
+- Upgrade dependencies to their latest versions, most notably upgrading
+ ``craft-cli`` from version `0.6.0` to `1.2.0`.
0.0.27 (2022-08-19)
===================
diff --git a/lpcraft/commands/run.py b/lpcraft/commands/run.py
index 803889a..8012ad4 100644
--- a/lpcraft/commands/run.py
+++ b/lpcraft/commands/run.py
@@ -378,7 +378,7 @@ def _run_instance_command(
full_run_cmd = ["bash", "--noprofile", "--norc", "-ec", command]
emit.progress("Running command for the job...")
original_mode = emit.get_mode()
- if original_mode == EmitterMode.NORMAL:
+ if original_mode == EmitterMode.BRIEF:
emit.set_mode(EmitterMode.VERBOSE)
with emit.open_stream(f"Running {full_run_cmd}") as stream:
proc = instance.execute_run(
@@ -388,7 +388,7 @@ def _run_instance_command(
stdout=stream,
stderr=stream,
)
- if original_mode == EmitterMode.NORMAL:
+ if original_mode == EmitterMode.BRIEF:
emit.set_mode(original_mode)
if proc.returncode != 0:
raise CommandError(
diff --git a/lpcraft/commands/tests/test_run.py b/lpcraft/commands/tests/test_run.py
index 604b13e..e06a28e 100644
--- a/lpcraft/commands/tests/test_run.py
+++ b/lpcraft/commands/tests/test_run.py
@@ -4,7 +4,6 @@
import io
import json
import os
-import re
import shutil
import subprocess
from pathlib import Path, PosixPath
@@ -2030,9 +2029,10 @@ class TestRun(RunBaseTestCase):
@patch("lpcraft.commands.run.get_provider")
@patch("lpcraft.commands.run.get_host_architecture", return_value="amd64")
@patch("sys.stderr", new_callable=io.StringIO)
- def test_normal(
+ def test_default_verbosity(
self, mock_stderr, mock_get_host_architecture, mock_get_provider
):
+ # default verbosity corresponds to the `BRIEF` mode
def execute_run(
command: List[str], **kwargs: Any
) -> "subprocess.CompletedProcess[AnyStr]":
@@ -2059,21 +2059,14 @@ class TestRun(RunBaseTestCase):
result = self.run_command("run")
self.assertEqual(0, result.exit_code)
- stderr_lines = [
- re.sub(
- r"^(?P<date>.+?) (?P<time>.+?) (?P<text>.*?) *$",
- r"\g<text>",
- line,
+ stderr_lines = mock_stderr.getvalue()
+
+ self.assertTrue(
+ stderr_lines.endswith(
+ "Running "
+ "['bash', '--noprofile', '--norc', '-ec', 'echo test']\n"
+ ":: test\n"
)
- for line in mock_stderr.getvalue().splitlines()
- ]
- self.assertEqual(
- [
- "Running ['bash', '--noprofile', '--norc', '-ec', "
- "'echo test']",
- ":: test",
- ],
- stderr_lines[-2:],
)
@patch("lpcraft.commands.run.get_provider")
diff --git a/lpcraft/main.py b/lpcraft/main.py
index f6263cf..fd08566 100644
--- a/lpcraft/main.py
+++ b/lpcraft/main.py
@@ -50,7 +50,7 @@ def main(argv: Optional[List[str]] = None) -> int:
if argv is None:
argv = sys.argv[1:]
- emit.init(EmitterMode.NORMAL, "lpcraft", f"Starting {lpcraft_version}")
+ emit.init(EmitterMode.BRIEF, "lpcraft", f"Starting {lpcraft_version}")
command_groups = [CommandGroup("Basic", _basic_commands)]
summary = "Run Launchpad CI jobs."
extra_global_args = [
diff --git a/lpcraft/tests/test_main.py b/lpcraft/tests/test_main.py
index 85aae92..d043637 100644
--- a/lpcraft/tests/test_main.py
+++ b/lpcraft/tests/test_main.py
@@ -22,7 +22,7 @@ class TestMain(TestCase):
self.assertEqual(0, ret)
mock_emit.init.assert_called_once_with(
- EmitterMode.NORMAL, "lpcraft", f"Starting {lpcraft_version}"
+ EmitterMode.BRIEF, "lpcraft", f"Starting {lpcraft_version}"
)
mock_emit.message.assert_called_once_with(lpcraft_version)
mock_emit.ended_ok.assert_called_once_with()
diff --git a/requirements.txt b/requirements.txt
index c36076e..8d896f6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,11 +4,11 @@
#
# pip-compile
#
-certifi==2021.10.8
+certifi==2022.6.15
# via requests
-charset-normalizer==2.0.12
+charset-normalizer==2.1.0
# via requests
-craft-cli==0.6.0
+craft-cli==1.2.0
# via -r requirements.in
craft-providers==1.3.1
# via -r requirements.in
@@ -18,7 +18,7 @@ platformdirs==2.5.2
# via craft-cli
pluggy==1.0.0
# via -r requirements.in
-pydantic==1.9.0
+pydantic==1.9.2
# via
# -r requirements.in
# craft-cli
@@ -30,11 +30,11 @@ pyyaml==6.0
# -r requirements.in
# craft-cli
# craft-providers
-requests==2.27.1
+requests==2.28.1
# via requests-unixsocket
requests-unixsocket==0.3.0
# via craft-providers
-typing-extensions==4.2.0
+typing-extensions==4.3.0
# via pydantic
-urllib3==1.26.9
+urllib3==1.26.11
# via requests