Colin Watson has proposed merging ~cjwatson/launchpad:lpci-rename into launchpad:master.
Commit message: Follow rename of lpcraft to lpci Requested reviews: Launchpad code reviewers (launchpad-reviewers) For more details, see: https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/441348 This has no externally-visible effect; it just updates internal names. -- Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:lpci-rename into launchpad:master.
diff --git a/lib/lp/code/configure.zcml b/lib/lp/code/configure.zcml index 48bde56..eaf4020 100644 --- a/lib/lp/code/configure.zcml +++ b/lib/lp/code/configure.zcml @@ -1280,9 +1280,9 @@ for="lp.code.interfaces.sourcepackagerecipe.ISourcePackageRecipe zope.lifecycleevent.interfaces.IObjectModifiedEvent" handler="lp.code.model.sourcepackagerecipe.recipe_modified"/> - <!-- LPCraftConfiguration --> - <class class="lp.code.model.lpcraft.LPCraftConfiguration"> - <allow interface="lp.code.interfaces.lpcraft.ILPCraftConfiguration" /> + <!-- LPCIConfiguration --> + <class class="lp.code.model.lpci.LPCIConfiguration"> + <allow interface="lp.code.interfaces.lpci.ILPCIConfiguration" /> </class> <!-- CIBuild --> diff --git a/lib/lp/code/interfaces/lpcraft.py b/lib/lp/code/interfaces/lpci.py similarity index 73% rename from lib/lp/code/interfaces/lpcraft.py rename to lib/lp/code/interfaces/lpci.py index 9ac4425..c8519ca 100644 --- a/lib/lp/code/interfaces/lpcraft.py +++ b/lib/lp/code/interfaces/lpci.py @@ -1,22 +1,22 @@ # Copyright 2022 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). -"""Interface to lpcraft's configuration file.""" +"""Interface to lpci's configuration file.""" __all__ = [ - "ILPCraftConfiguration", - "LPCraftConfigurationError", + "ILPCIConfiguration", + "LPCIConfigurationError", ] from zope.interface import Interface from zope.schema import Dict, List, TextLine -class LPCraftConfigurationError(Exception): - """Parsing lpcraft's configuration file failed.""" +class LPCIConfigurationError(Exception): + """Parsing lpci's configuration file failed.""" -class ILPCraftConfiguration(Interface): +class ILPCIConfiguration(Interface): """An object representation of a `.launchpad.yaml` file.""" pipeline = List( diff --git a/lib/lp/code/model/cibuild.py b/lib/lp/code/model/cibuild.py index 23cb47a..ad5bbfb 100644 --- a/lib/lp/code/model/cibuild.py +++ b/lib/lp/code/model/cibuild.py @@ -50,7 +50,7 @@ from lp.code.interfaces.githosting import IGitHostingClient from lp.code.interfaces.gitrepository import IGitRepository from lp.code.interfaces.revisionstatus import IRevisionStatusReportSet from lp.code.model.gitref import GitRef -from lp.code.model.lpcraft import load_configuration +from lp.code.model.lpci import load_configuration from lp.code.model.revisionstatus import ( RevisionStatusArtifact, RevisionStatusReport, @@ -726,8 +726,8 @@ class CIBuildSet(SpecificBuildFarmJobSourceMixin): commit_sha1s, # XXX cjwatson 2022-01-19: We should also fetch # debian/.launchpad.yaml (or perhaps make the path a property of - # the repository) once lpcraft and launchpad-buildd support - # using alternative paths for builds. + # the repository) once lpci and launchpad-buildd support using + # alternative paths for builds. filter_paths=[".launchpad.yaml"], logger=logger, ) diff --git a/lib/lp/code/model/lpcraft.py b/lib/lp/code/model/lpci.py similarity index 78% rename from lib/lp/code/model/lpcraft.py rename to lib/lp/code/model/lpci.py index 8a196c2..1aa04e2 100644 --- a/lib/lp/code/model/lpcraft.py +++ b/lib/lp/code/model/lpci.py @@ -1,16 +1,16 @@ # Copyright 2022 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). -"""This module provides a parser for lpcraft's configuration file. +"""This module provides a parser for lpci's configuration file. As currently Launchpad is only compatible with Python 3.5, it was not possible -to reuse lpcraft's parser. +to reuse lpci's parser. -The implementation was copied from https://launchpad.net/lpcraft -> -`lpcraft/config.py`. +The implementation was copied from https://launchpad.net/lpci -> +`lpci/config.py`. -XXX jugmac00 2022-01-07: use lpcraft for parsing the configuration file once -we are on Python 3.8 +XXX jugmac00 2022-01-07: use lpci for parsing the configuration file once we +are on Python 3.8 """ __all__ = ["load_configuration"] @@ -18,10 +18,7 @@ __all__ = ["load_configuration"] import yaml from zope.interface import implementer -from lp.code.interfaces.lpcraft import ( - ILPCraftConfiguration, - LPCraftConfigurationError, -) +from lp.code.interfaces.lpci import ILPCIConfiguration, LPCIConfigurationError def _expand_job_values(values): @@ -54,10 +51,10 @@ def load_configuration(configuration_file): # load yaml content = yaml.safe_load(configuration_file) if content is None: - raise LPCraftConfigurationError("Empty configuration file") + raise LPCIConfigurationError("Empty configuration file") for required_key in "pipeline", "jobs": if required_key not in content: - raise LPCraftConfigurationError( + raise LPCIConfigurationError( "Configuration file does not declare '{}'".format(required_key) ) # normalize each element of `pipeline` into a list @@ -75,18 +72,18 @@ def load_configuration(configuration_file): for i, job_values in enumerate(expanded_job_values): for required_key in "series", "architectures": if required_key not in job_values: - raise LPCraftConfigurationError( + raise LPCIConfigurationError( "Job {}:{} does not declare '{}'".format( job_name, i, required_key ) ) # create "data class" - return LPCraftConfiguration(expanded_values) + return LPCIConfiguration(expanded_values) -@implementer(ILPCraftConfiguration) -class LPCraftConfiguration: - """See `ILPCraftConfiguration`.""" +@implementer(ILPCIConfiguration) +class LPCIConfiguration: + """See `ILPCIConfiguration`.""" def __init__(self, d): self.__dict__.update(d) diff --git a/lib/lp/code/model/tests/test_cibuild.py b/lib/lp/code/model/tests/test_cibuild.py index 722ecb2..ec452d6 100644 --- a/lib/lp/code/model/tests/test_cibuild.py +++ b/lib/lp/code/model/tests/test_cibuild.py @@ -48,7 +48,7 @@ from lp.code.model.cibuild import ( determine_DASes_to_build, get_all_commits_for_paths, ) -from lp.code.model.lpcraft import load_configuration +from lp.code.model.lpci import load_configuration from lp.code.tests.helpers import GitHostingFixture from lp.registry.interfaces.series import SeriesStatus from lp.registry.interfaces.sourcepackage import SourcePackageType diff --git a/lib/lp/code/model/tests/test_lpcraft.py b/lib/lp/code/model/tests/test_lpci.py similarity index 88% rename from lib/lp/code/model/tests/test_lpcraft.py rename to lib/lp/code/model/tests/test_lpci.py index 5045aa3..1cddc56 100644 --- a/lib/lp/code/model/tests/test_lpcraft.py +++ b/lib/lp/code/model/tests/test_lpci.py @@ -3,11 +3,8 @@ from textwrap import dedent -from lp.code.interfaces.lpcraft import ( - ILPCraftConfiguration, - LPCraftConfigurationError, -) -from lp.code.model.lpcraft import load_configuration +from lp.code.interfaces.lpci import ILPCIConfiguration, LPCIConfigurationError +from lp.code.model.lpci import load_configuration from lp.testing import TestCase @@ -26,11 +23,11 @@ class TestLoadConfiguration(TestCase): configuration = load_configuration(c) - self.assertProvides(configuration, ILPCraftConfiguration) + self.assertProvides(configuration, ILPCIConfiguration) def test_load_configuration_empty(self): self.assertRaisesWithContent( - LPCraftConfigurationError, + LPCIConfigurationError, "Empty configuration file", load_configuration, "", @@ -45,7 +42,7 @@ class TestLoadConfiguration(TestCase): ) self.assertRaisesWithContent( - LPCraftConfigurationError, + LPCIConfigurationError, "Configuration file does not declare 'pipeline'", load_configuration, c, @@ -60,7 +57,7 @@ class TestLoadConfiguration(TestCase): ) self.assertRaisesWithContent( - LPCraftConfigurationError, + LPCIConfigurationError, "Configuration file does not declare 'jobs'", load_configuration, c, @@ -77,7 +74,7 @@ class TestLoadConfiguration(TestCase): ) self.assertRaisesWithContent( - LPCraftConfigurationError, + LPCIConfigurationError, "Job test:0 does not declare 'series'", load_configuration, c, @@ -95,7 +92,7 @@ class TestLoadConfiguration(TestCase): ) self.assertRaisesWithContent( - LPCraftConfigurationError, + LPCIConfigurationError, "Job test:0 does not declare 'architectures'", load_configuration, c,
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : launchpad-reviewers@lists.launchpad.net Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp