Skip to content
Snippets Groups Projects
Commit 11bbdb13 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

utils.py: Added get_bst_version() API

Fetches the numeric major/minor version of the BuildStream package.
parent 68493ad7
No related branches found
No related tags found
Loading
......@@ -32,6 +32,7 @@ import subprocess
import signal
import re
import tempfile
import pkg_resources
from contextlib import contextmanager
from . import ProgramNotFoundError
from . import _yaml
......@@ -425,6 +426,20 @@ def url_directory_name(url):
return ''.join([transl(x) for x in url])
def get_bst_version():
"""Gets the major, minor release portion of the
BuildStream version.
Returns:
(int): The major version
(int): The minor version
"""
package = pkg_resources.require("buildstream")[0]
versions = package.version.split('.')[:2]
return (int(versions[0]), int(versions[1]))
# Recursively make directories in target area and copy permissions
def _copy_directories(srcdir, destdir, target):
this_dir = os.path.dirname(target)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment