diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-10-12 00:35:53 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-10-12 00:37:51 +0900 |
commit | 4f0bfb4ae0551b1ee10af90a1505c973c9c7863b (patch) | |
tree | b3c8991bc4a665f71262a7269a894c9162cafad3 | |
parent | 39492db848a193d2d8bc1b827b3bd1934bdd7a3f (diff) | |
download | buildstream-4f0bfb4ae0551b1ee10af90a1505c973c9c7863b.tar.gz |
Rename element_enums.py -> types.py
This will be the place to store low level data types used
throughout the core, for now this includes public and private
types.
-rw-r--r-- | buildstream/__init__.py | 2 | ||||
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 2 | ||||
-rw-r--r-- | buildstream/element.py | 4 | ||||
-rw-r--r-- | buildstream/types.py (renamed from buildstream/element_enums.py) | 34 |
4 files changed, 21 insertions, 21 deletions
diff --git a/buildstream/__init__.py b/buildstream/__init__.py index 0f6efb0da..658166a99 100644 --- a/buildstream/__init__.py +++ b/buildstream/__init__.py @@ -28,9 +28,9 @@ if "_BST_COMPLETION" not in os.environ: from .utils import UtilError, ProgramNotFoundError from .sandbox import Sandbox, SandboxFlags + from .types import Scope from .plugin import Plugin from .source import Source, SourceError, Consistency, SourceFetcher from .element import Element, ElementError - from .element_enums import Scope from .buildelement import BuildElement from .scriptelement import ScriptElement diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index 6a9b57f2c..ecb5738d7 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -21,7 +21,7 @@ import os import string from collections import Mapping, namedtuple -from ..element_enums import _KeyStrength +from ..types import _KeyStrength from .._exceptions import ArtifactError, ImplError, LoadError, LoadErrorReason from .._message import Message, MessageType from .. import utils diff --git a/buildstream/element.py b/buildstream/element.py index aff185405..a77550f9d 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -86,7 +86,7 @@ from ._variables import Variables from ._versions import BST_CORE_ARTIFACT_VERSION from ._exceptions import BstError, LoadError, LoadErrorReason, ImplError, ErrorDomain from .utils import UtilError -from . import Plugin, Consistency +from . import Plugin, Consistency, Scope from . import SandboxFlags from . import utils from . import _cachekey @@ -96,11 +96,11 @@ from ._platform import Platform from .plugin import CoreWarnings from .sandbox._config import SandboxConfig from .sandbox._sandboxremote import SandboxRemote +from .types import _KeyStrength from .storage.directory import Directory from .storage._filebaseddirectory import FileBasedDirectory from .storage.directory import VirtualDirectoryError -from .element_enums import _KeyStrength, Scope class ElementError(BstError): diff --git a/buildstream/element_enums.py b/buildstream/types.py index 2f2fb54d2..3c27d583a 100644 --- a/buildstream/element_enums.py +++ b/buildstream/types.py @@ -19,29 +19,14 @@ # Jim MacArthur <jim.macarthur@codethink.co.uk> """ -Element - Globally visible enumerations -======================================= +Foundation types +================ """ from enum import Enum -# _KeyStrength(): -# -# Strength of cache key -# -class _KeyStrength(Enum): - - # Includes strong cache keys of all build dependencies and their - # runtime dependencies. - STRONG = 1 - - # Includes names of direct build dependencies but does not include - # cache keys of dependencies. - WEAK = 2 - - class Scope(Enum): """Types of scope for a given element""" @@ -59,3 +44,18 @@ class Scope(Enum): """All elements required for running the element. Including the element itself. """ + + +# _KeyStrength(): +# +# Strength of cache key +# +class _KeyStrength(Enum): + + # Includes strong cache keys of all build dependencies and their + # runtime dependencies. + STRONG = 1 + + # Includes names of direct build dependencies but does not include + # cache keys of dependencies. + WEAK = 2 |