Merge ~cjwatson/launchpad:lpci-rename into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: db7cb187774570d96b82371d157e07ad80e27c85
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:lpci-rename
Merge into: launchpad:master
Diff against target: 240 lines (+35/-41)
6 files modified
lib/lp/code/configure.zcml (+3/-3)
lib/lp/code/interfaces/lpci.py (+6/-6)
lib/lp/code/model/cibuild.py (+3/-3)
lib/lp/code/model/lpci.py (+14/-17)
lib/lp/code/model/tests/test_cibuild.py (+1/-1)
lib/lp/code/model/tests/test_lpci.py (+8/-11)
Reviewer Review Type Date Requested Status
Ines Almeida Approve
Review via email: mp+441348@code.launchpad.net

Commit message

Follow rename of lpcraft to lpci

Description of the change

This has no externally-visible effect; it just updates internal names.

To post a comment you must log in.
Revision history for this message
Ines Almeida (ines-almeida) wrote :

Looks good 👍

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/code/configure.zcml b/lib/lp/code/configure.zcml
2index 48bde56..eaf4020 100644
3--- a/lib/lp/code/configure.zcml
4+++ b/lib/lp/code/configure.zcml
5@@ -1280,9 +1280,9 @@
6 for="lp.code.interfaces.sourcepackagerecipe.ISourcePackageRecipe zope.lifecycleevent.interfaces.IObjectModifiedEvent"
7 handler="lp.code.model.sourcepackagerecipe.recipe_modified"/>
8
9- <!-- LPCraftConfiguration -->
10- <class class="lp.code.model.lpcraft.LPCraftConfiguration">
11- <allow interface="lp.code.interfaces.lpcraft.ILPCraftConfiguration" />
12+ <!-- LPCIConfiguration -->
13+ <class class="lp.code.model.lpci.LPCIConfiguration">
14+ <allow interface="lp.code.interfaces.lpci.ILPCIConfiguration" />
15 </class>
16
17 <!-- CIBuild -->
18diff --git a/lib/lp/code/interfaces/lpcraft.py b/lib/lp/code/interfaces/lpci.py
19similarity index 73%
20rename from lib/lp/code/interfaces/lpcraft.py
21rename to lib/lp/code/interfaces/lpci.py
22index 9ac4425..c8519ca 100644
23--- a/lib/lp/code/interfaces/lpcraft.py
24+++ b/lib/lp/code/interfaces/lpci.py
25@@ -1,22 +1,22 @@
26 # Copyright 2022 Canonical Ltd. This software is licensed under the
27 # GNU Affero General Public License version 3 (see the file LICENSE).
28
29-"""Interface to lpcraft's configuration file."""
30+"""Interface to lpci's configuration file."""
31
32 __all__ = [
33- "ILPCraftConfiguration",
34- "LPCraftConfigurationError",
35+ "ILPCIConfiguration",
36+ "LPCIConfigurationError",
37 ]
38
39 from zope.interface import Interface
40 from zope.schema import Dict, List, TextLine
41
42
43-class LPCraftConfigurationError(Exception):
44- """Parsing lpcraft's configuration file failed."""
45+class LPCIConfigurationError(Exception):
46+ """Parsing lpci's configuration file failed."""
47
48
49-class ILPCraftConfiguration(Interface):
50+class ILPCIConfiguration(Interface):
51 """An object representation of a `.launchpad.yaml` file."""
52
53 pipeline = List(
54diff --git a/lib/lp/code/model/cibuild.py b/lib/lp/code/model/cibuild.py
55index 23cb47a..ad5bbfb 100644
56--- a/lib/lp/code/model/cibuild.py
57+++ b/lib/lp/code/model/cibuild.py
58@@ -50,7 +50,7 @@ from lp.code.interfaces.githosting import IGitHostingClient
59 from lp.code.interfaces.gitrepository import IGitRepository
60 from lp.code.interfaces.revisionstatus import IRevisionStatusReportSet
61 from lp.code.model.gitref import GitRef
62-from lp.code.model.lpcraft import load_configuration
63+from lp.code.model.lpci import load_configuration
64 from lp.code.model.revisionstatus import (
65 RevisionStatusArtifact,
66 RevisionStatusReport,
67@@ -726,8 +726,8 @@ class CIBuildSet(SpecificBuildFarmJobSourceMixin):
68 commit_sha1s,
69 # XXX cjwatson 2022-01-19: We should also fetch
70 # debian/.launchpad.yaml (or perhaps make the path a property of
71- # the repository) once lpcraft and launchpad-buildd support
72- # using alternative paths for builds.
73+ # the repository) once lpci and launchpad-buildd support using
74+ # alternative paths for builds.
75 filter_paths=[".launchpad.yaml"],
76 logger=logger,
77 )
78diff --git a/lib/lp/code/model/lpcraft.py b/lib/lp/code/model/lpci.py
79similarity index 78%
80rename from lib/lp/code/model/lpcraft.py
81rename to lib/lp/code/model/lpci.py
82index 8a196c2..1aa04e2 100644
83--- a/lib/lp/code/model/lpcraft.py
84+++ b/lib/lp/code/model/lpci.py
85@@ -1,16 +1,16 @@
86 # Copyright 2022 Canonical Ltd. This software is licensed under the
87 # GNU Affero General Public License version 3 (see the file LICENSE).
88
89-"""This module provides a parser for lpcraft's configuration file.
90+"""This module provides a parser for lpci's configuration file.
91
92 As currently Launchpad is only compatible with Python 3.5, it was not possible
93-to reuse lpcraft's parser.
94+to reuse lpci's parser.
95
96-The implementation was copied from https://launchpad.net/lpcraft ->
97-`lpcraft/config.py`.
98+The implementation was copied from https://launchpad.net/lpci ->
99+`lpci/config.py`.
100
101-XXX jugmac00 2022-01-07: use lpcraft for parsing the configuration file once
102-we are on Python 3.8
103+XXX jugmac00 2022-01-07: use lpci for parsing the configuration file once we
104+are on Python 3.8
105 """
106
107 __all__ = ["load_configuration"]
108@@ -18,10 +18,7 @@ __all__ = ["load_configuration"]
109 import yaml
110 from zope.interface import implementer
111
112-from lp.code.interfaces.lpcraft import (
113- ILPCraftConfiguration,
114- LPCraftConfigurationError,
115-)
116+from lp.code.interfaces.lpci import ILPCIConfiguration, LPCIConfigurationError
117
118
119 def _expand_job_values(values):
120@@ -54,10 +51,10 @@ def load_configuration(configuration_file):
121 # load yaml
122 content = yaml.safe_load(configuration_file)
123 if content is None:
124- raise LPCraftConfigurationError("Empty configuration file")
125+ raise LPCIConfigurationError("Empty configuration file")
126 for required_key in "pipeline", "jobs":
127 if required_key not in content:
128- raise LPCraftConfigurationError(
129+ raise LPCIConfigurationError(
130 "Configuration file does not declare '{}'".format(required_key)
131 )
132 # normalize each element of `pipeline` into a list
133@@ -75,18 +72,18 @@ def load_configuration(configuration_file):
134 for i, job_values in enumerate(expanded_job_values):
135 for required_key in "series", "architectures":
136 if required_key not in job_values:
137- raise LPCraftConfigurationError(
138+ raise LPCIConfigurationError(
139 "Job {}:{} does not declare '{}'".format(
140 job_name, i, required_key
141 )
142 )
143 # create "data class"
144- return LPCraftConfiguration(expanded_values)
145+ return LPCIConfiguration(expanded_values)
146
147
148-@implementer(ILPCraftConfiguration)
149-class LPCraftConfiguration:
150- """See `ILPCraftConfiguration`."""
151+@implementer(ILPCIConfiguration)
152+class LPCIConfiguration:
153+ """See `ILPCIConfiguration`."""
154
155 def __init__(self, d):
156 self.__dict__.update(d)
157diff --git a/lib/lp/code/model/tests/test_cibuild.py b/lib/lp/code/model/tests/test_cibuild.py
158index 722ecb2..ec452d6 100644
159--- a/lib/lp/code/model/tests/test_cibuild.py
160+++ b/lib/lp/code/model/tests/test_cibuild.py
161@@ -48,7 +48,7 @@ from lp.code.model.cibuild import (
162 determine_DASes_to_build,
163 get_all_commits_for_paths,
164 )
165-from lp.code.model.lpcraft import load_configuration
166+from lp.code.model.lpci import load_configuration
167 from lp.code.tests.helpers import GitHostingFixture
168 from lp.registry.interfaces.series import SeriesStatus
169 from lp.registry.interfaces.sourcepackage import SourcePackageType
170diff --git a/lib/lp/code/model/tests/test_lpcraft.py b/lib/lp/code/model/tests/test_lpci.py
171similarity index 88%
172rename from lib/lp/code/model/tests/test_lpcraft.py
173rename to lib/lp/code/model/tests/test_lpci.py
174index 5045aa3..1cddc56 100644
175--- a/lib/lp/code/model/tests/test_lpcraft.py
176+++ b/lib/lp/code/model/tests/test_lpci.py
177@@ -3,11 +3,8 @@
178
179 from textwrap import dedent
180
181-from lp.code.interfaces.lpcraft import (
182- ILPCraftConfiguration,
183- LPCraftConfigurationError,
184-)
185-from lp.code.model.lpcraft import load_configuration
186+from lp.code.interfaces.lpci import ILPCIConfiguration, LPCIConfigurationError
187+from lp.code.model.lpci import load_configuration
188 from lp.testing import TestCase
189
190
191@@ -26,11 +23,11 @@ class TestLoadConfiguration(TestCase):
192
193 configuration = load_configuration(c)
194
195- self.assertProvides(configuration, ILPCraftConfiguration)
196+ self.assertProvides(configuration, ILPCIConfiguration)
197
198 def test_load_configuration_empty(self):
199 self.assertRaisesWithContent(
200- LPCraftConfigurationError,
201+ LPCIConfigurationError,
202 "Empty configuration file",
203 load_configuration,
204 "",
205@@ -45,7 +42,7 @@ class TestLoadConfiguration(TestCase):
206 )
207
208 self.assertRaisesWithContent(
209- LPCraftConfigurationError,
210+ LPCIConfigurationError,
211 "Configuration file does not declare 'pipeline'",
212 load_configuration,
213 c,
214@@ -60,7 +57,7 @@ class TestLoadConfiguration(TestCase):
215 )
216
217 self.assertRaisesWithContent(
218- LPCraftConfigurationError,
219+ LPCIConfigurationError,
220 "Configuration file does not declare 'jobs'",
221 load_configuration,
222 c,
223@@ -77,7 +74,7 @@ class TestLoadConfiguration(TestCase):
224 )
225
226 self.assertRaisesWithContent(
227- LPCraftConfigurationError,
228+ LPCIConfigurationError,
229 "Job test:0 does not declare 'series'",
230 load_configuration,
231 c,
232@@ -95,7 +92,7 @@ class TestLoadConfiguration(TestCase):
233 )
234
235 self.assertRaisesWithContent(
236- LPCraftConfigurationError,
237+ LPCIConfigurationError,
238 "Job test:0 does not declare 'architectures'",
239 load_configuration,
240 c,

Subscribers

People subscribed via source and target branches

to status/vote changes: