Merge ~cjwatson/lpci:rename-warning into lpci:old-lpcraft

Proposed by Colin Watson
Status: Merged
Merged at revision: c5b67a02c3614d80a25c1477c9f132c28f676aca
Proposed branch: ~cjwatson/lpci:rename-warning
Merge into: lpci:old-lpcraft
Diff against target: 64 lines (+19/-2)
4 files modified
NEWS.rst (+5/-0)
lpcraft/main.py (+4/-0)
lpcraft/tests/test_main.py (+9/-1)
setup.cfg (+1/-1)
Reviewer Review Type Date Requested Status
Simone Pelosi Approve
Review via email: mp+441332@code.launchpad.net

Commit message

Display notice advising users to switch to lpci

Description of the change

Snaps don't really support being renamed. This is the next best thing.

To post a comment you must log in.
Revision history for this message
Simone Pelosi (pelpsi) :
review: Approve
Revision history for this message
Simone Pelosi (pelpsi) wrote :

LGTM!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/NEWS.rst b/NEWS.rst
2index a422ffe..12c785c 100644
3--- a/NEWS.rst
4+++ b/NEWS.rst
5@@ -2,6 +2,11 @@
6 Version history
7 ===============
8
9+0.0.52.1 (unreleased)
10+=====================
11+
12+- Display notice advising users to switch to ``lpci``.
13+
14 0.0.52 (2023-04-06)
15 ===================
16 - Fix regression from adding support to snap keys
17diff --git a/lpcraft/main.py b/lpcraft/main.py
18index fd08566..29cb4ab 100644
19--- a/lpcraft/main.py
20+++ b/lpcraft/main.py
21@@ -51,6 +51,10 @@ def main(argv: Optional[List[str]] = None) -> int:
22 argv = sys.argv[1:]
23
24 emit.init(EmitterMode.BRIEF, "lpcraft", f"Starting {lpcraft_version}")
25+ emit.message(
26+ "lpcraft has been replaced by lpci. "
27+ "Run `sudo snap install --classic lpci` to install it."
28+ )
29 command_groups = [CommandGroup("Basic", _basic_commands)]
30 summary = "Run Launchpad CI jobs."
31 extra_global_args = [
32diff --git a/lpcraft/tests/test_main.py b/lpcraft/tests/test_main.py
33index d043637..369325c 100644
34--- a/lpcraft/tests/test_main.py
35+++ b/lpcraft/tests/test_main.py
36@@ -24,7 +24,15 @@ class TestMain(TestCase):
37 mock_emit.init.assert_called_once_with(
38 EmitterMode.BRIEF, "lpcraft", f"Starting {lpcraft_version}"
39 )
40- mock_emit.message.assert_called_once_with(lpcraft_version)
41+ mock_emit.message.assert_has_calls(
42+ [
43+ call(
44+ "lpcraft has been replaced by lpci. "
45+ "Run `sudo snap install --classic lpci` to install it."
46+ ),
47+ call(lpcraft_version),
48+ ]
49+ )
50 mock_emit.ended_ok.assert_called_once_with()
51
52 @patch("sys.stderr", new_callable=io.StringIO)
53diff --git a/setup.cfg b/setup.cfg
54index 2045068..f8a79cf 100644
55--- a/setup.cfg
56+++ b/setup.cfg
57@@ -1,6 +1,6 @@
58 [metadata]
59 name = lpcraft
60-version = 0.0.52
61+version = 0.0.52.1.dev0
62 description = Runner for Launchpad CI jobs
63 long_description = file: README.rst
64 long_description_content_type = text/x-rst

Subscribers

People subscribed via source and target branches