diff options
| author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-20 20:30:17 +0900 |
|---|---|---|
| committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-25 00:16:01 +0900 |
| commit | 6ef6be52c1cd66245fc7f13a3c472024e10c3c1a (patch) | |
| tree | 19e1fa50917931aac784bca94d765f132c75805d /src/buildstream/testing/_sourcetests | |
| parent | bacc060cfcf32cdb696ce1a3ef195ea9bed0d8c1 (diff) | |
| download | buildstream-6ef6be52c1cd66245fc7f13a3c472024e10c3c1a.tar.gz | |
Replace format-version with min-version
* "min-version" is specified as a <major>.<minor> point version
and uses the installed BuildStream version instead of having
a separate versioning number for the format.
* The presence of "format-version" is now used to indicate
that we might be loading a BuildStream 1 project.
* For now, where parsing the version at startup is concerned, and
also where `bst init` is concerned, we artificially bump the
detected BuildStream version to 2.0 if we detect a version < 2.0,
these exceptions can be removed once 2.0 is tagged and released.
Summary of changes:
_project.py: Now parse "min-version" and detect "format-version" to
warn about loading a BuildStream 1 project
_versions.py: Remove obsolete BST_FORMAT_VERSION numbers from here
data/projectconfig.yaml: Remove old "format-version" from defaults
utils.py: Added new private _parse_version() helper function, and another
_get_bst_api_version() to get an adjusted API version.
frontend/app.py, frontend/cli.py: Updated `bst init` implementation
testing (buildstream.testing): Updated testing utilities to generate
and use projects with min-version instead of format-version.
tests and examples: Updated to use min-version across the board.
Diffstat (limited to 'src/buildstream/testing/_sourcetests')
4 files changed, 5 insertions, 4 deletions
diff --git a/src/buildstream/testing/_sourcetests/mirror.py b/src/buildstream/testing/_sourcetests/mirror.py index de05b894c..69042747c 100644 --- a/src/buildstream/testing/_sourcetests/mirror.py +++ b/src/buildstream/testing/_sourcetests/mirror.py @@ -156,7 +156,7 @@ def test_mirror_from_includes(cli, tmpdir, datafiles, kind): config_project_dir = str(tmpdir.join("config")) os.makedirs(config_project_dir, exist_ok=True) - config_project = {"name": "config"} + config_project = {"name": "config", "min-version": "2.0"} _yaml.roundtrip_dump(config_project, os.path.join(config_project_dir, "project.conf")) extra_mirrors = {"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],}}]} _yaml.roundtrip_dump(extra_mirrors, os.path.join(config_project_dir, "mirrors.yml")) @@ -199,7 +199,7 @@ def test_mirror_junction_from_includes(cli, tmpdir, datafiles, kind): config_project_dir = str(tmpdir.join("config")) os.makedirs(config_project_dir, exist_ok=True) - config_project = {"name": "config"} + config_project = {"name": "config", "min-version": "2.0"} _yaml.roundtrip_dump(config_project, os.path.join(config_project_dir, "project.conf")) extra_mirrors = {"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],}}]} _yaml.roundtrip_dump(extra_mirrors, os.path.join(config_project_dir, "mirrors.yml")) diff --git a/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf b/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf index bbb8414a3..74cfd2583 100644 --- a/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf +++ b/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf @@ -1,4 +1,4 @@ # Project config for frontend build test name: subtest - +min-version: 2.0 element-path: elements diff --git a/src/buildstream/testing/_sourcetests/project/project.conf b/src/buildstream/testing/_sourcetests/project/project.conf index 05b68bfeb..22fe9477f 100644 --- a/src/buildstream/testing/_sourcetests/project/project.conf +++ b/src/buildstream/testing/_sourcetests/project/project.conf @@ -1,5 +1,6 @@ # Project config for frontend build test name: test +min-version: 2.0 element-path: elements aliases: alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/ diff --git a/src/buildstream/testing/_sourcetests/track_cross_junction.py b/src/buildstream/testing/_sourcetests/track_cross_junction.py index 2477b37ee..2c4141936 100644 --- a/src/buildstream/testing/_sourcetests/track_cross_junction.py +++ b/src/buildstream/testing/_sourcetests/track_cross_junction.py @@ -68,7 +68,7 @@ def generate_project(tmpdir, name, kind, config=None): subproject_path = os.path.join(str(tmpdir.join(project_name))) os.makedirs(os.path.join(subproject_path, "elements")) - project_conf = {"name": name, "element-path": "elements"} + project_conf = {"name": name, "min-version": "2.0", "element-path": "elements"} project_conf.update(config) _yaml.roundtrip_dump(project_conf, os.path.join(subproject_path, "project.conf")) add_plugins_conf(subproject_path, kind) |
