BuildStream can not build from non-numeric tags

Background

[//]: # Trying to build with BuildStream tag PRE_CAS_MERGE_JULY_2018 doesn't work

Task description

[//]: # Summary:

  • Please see the log and follow the steps shown on it

Acceptance Criteria

[//]: # BuildStream should build from any tag in the respository if documentation says you can use BuildStream from source

Error log and Steps to reproduce

  • NOTE: the user had buildstream installed in the system using "pip3 install --user -e ." in previous versions
$ cd buildstream

$ git checkout PRE_CAS_MERGE_JULY_2018
Note: checking out 'PRE_CAS_MERGE_JULY_2018'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 4c6512d6... Only redirect elements for workspace and track operations

$ pip3 uninstall buildstream
Uninstalling BuildStream-1.1.3+235.g1016dcb4:
  /home/levy/.local/lib/python3.5/site-packages/BuildStream.egg-link
Proceed (y/n)? y
  Successfully uninstalled BuildStream-1.1.3+235.g1016dcb4

$ pip3 install --user -e .
Obtaining file:///home/levy/repositories/buildstream
Collecting setuptools (from BuildStream===PRE-CAS-MERGE-JULY-2018)
  Using cached https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl
Collecting psutil (from BuildStream===PRE-CAS-MERGE-JULY-2018)
Collecting ruamel.yaml (from BuildStream===PRE-CAS-MERGE-JULY-2018)
  Using cached https://files.pythonhosted.org/packages/03/4d/c3f1fa742b627ebe97e63ed71e2dedd23462a1369df374944270f75bb1e2/ruamel.yaml-0.15.44-cp35-cp35m-manylinux1_x86_64.whl
Collecting pluginbase (from BuildStream===PRE-CAS-MERGE-JULY-2018)
Collecting Click (from BuildStream===PRE-CAS-MERGE-JULY-2018)
  Using cached https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Collecting blessings (from BuildStream===PRE-CAS-MERGE-JULY-2018)
  Using cached https://files.pythonhosted.org/packages/03/74/489f85a78247609c6b4f13733cbf3ba0d864b11aa565617b645d6fdf2a4a/blessings-1.7-py3-none-any.whl
Collecting jinja2>=2.10 (from BuildStream===PRE-CAS-MERGE-JULY-2018)
  Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting six (from blessings->BuildStream===PRE-CAS-MERGE-JULY-2018)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2>=2.10->BuildStream===PRE-CAS-MERGE-JULY-2018)
Installing collected packages: setuptools, psutil, ruamel.yaml, pluginbase, Click, six, blessings, MarkupSafe, jinja2, BuildStream
  Running setup.py develop for BuildStream
Successfully installed BuildStream Click-6.7 MarkupSafe-1.0 blessings-1.7 jinja2-2.10 pluginbase-0.7 psutil-5.4.6 ruamel.yaml-0.15.44 setuptools-40.0.0 six-1.11.0

$ git clone git@gitlab.com:baserock/definitions.git

$ cd definitions

$ bst --verbose --debug build systems/minimal-system-image-x86_64.bst 
pid:12253 id:000[--:--:--][][] START   Build
pid:12253 id:000[--:--:--][][] START   Loading pipeline
pid:12253 id:000[00:00:01][][] SUCCESS Loading pipeline
pid:12253 id:000[--:--:--][][] START   Resolving pipeline
pid:12253 id:000[--:--:--][][] BUG     invalid literal for int() with base 10: 'PRE_CAS_MERGE_JULY_2018'

    Traceback (most recent call last):
      File "/home/levy/.local/bin/bst", line 8, in <module>
        sys.exit(cli())
      File "/home/levy/.local/lib/python3.5/site-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "/home/levy/repositories/buildstream/buildstream/_frontend/cli.py", line 162, in override_main
        standalone_mode=standalone_mode, **extra)
      File "/home/levy/.local/lib/python3.5/site-packages/click/core.py", line 697, in main
        rv = self.invoke(ctx)
      File "/home/levy/.local/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/levy/.local/lib/python3.5/site-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/levy/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "/home/levy/.local/lib/python3.5/site-packages/click/decorators.py", line 27, in new_func
        return f(get_current_context().obj, *args, **kwargs)
      File "/home/levy/repositories/buildstream/buildstream/_frontend/cli.py", line 328, in build
        build_all=all_)
      File "/home/levy/repositories/buildstream/buildstream/_stream.py", line 184, in build
        dynamic_plan=True)
      File "/home/levy/repositories/buildstream/buildstream/_stream.py", line 820, in _load
        fetch_subprojects=fetch_subprojects)
      File "/home/levy/repositories/buildstream/buildstream/_pipeline.py", line 122, in load
        for meta in meta_elements
      File "/home/levy/repositories/buildstream/buildstream/_pipeline.py", line 122, in <listcomp>
        for meta in meta_elements
      File "/home/levy/repositories/buildstream/buildstream/element.py", line 894, in _new_from_meta
        element = project.create_element(artifacts, meta)
      File "/home/levy/repositories/buildstream/buildstream/_project.py", line 184, in create_element
        element = self._element_factory.create(self._context, self, artifacts, meta)
      File "/home/levy/repositories/buildstream/buildstream/_elementfactory.py", line 56, in create
        element_type, default_config = self.lookup(meta.kind)
      File "/home/levy/repositories/buildstream/buildstream/_plugincontext.py", line 74, in lookup
        return self._ensure_plugin(kind)
      File "/home/levy/repositories/buildstream/buildstream/_plugincontext.py", line 158, in _ensure_plugin
        self._types[kind] = self._load_plugin(source, kind, defaults)
      File "/home/levy/repositories/buildstream/buildstream/_plugincontext.py", line 189, in _load_plugin
        self._assert_version(kind, plugin_type)
      File "/home/levy/repositories/buildstream/buildstream/_plugincontext.py", line 211, in _assert_version
        bst_major, bst_minor = utils.get_bst_version()
      File "/home/levy/repositories/buildstream/buildstream/utils.py", line 478, in get_bst_version
        return (int(versions[0]), int(versions[1]))
    ValueError: invalid literal for int() with base 10: 'PRE_CAS_MERGE_JULY_2018'
Edited by Tristan Van Berkom