diff options
author | Gökçen Nurlu <gnurlu1@bloomberg.net> | 2018-01-11 18:06:45 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-01-31 15:48:15 +0100 |
commit | 8890142147a6f3a460a0f7a0690996a9c6b48137 (patch) | |
tree | dac7d0f6c4673c02d132132f4e530162841ffab5 /setup.py | |
parent | 4304611452a9ba8f461e302d2852c54023356826 (diff) | |
download | buildstream-8890142147a6f3a460a0f7a0690996a9c6b48137.tar.gz |
Get version number w/o pkg_resources
This removes most of the usages of pkg_resources from the codebase, helping
the goal of getting rid of that completely.
With this change, version number is generated during install and embedded into
`__version__` which is then imported by root level `__init__`. From there,
it is used by other parts of the codebase when needed.
Generated `__version__` file is ignored and not tracked by git to prevent
unnecessary 'changes' messages and accidental commits of that file.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -133,6 +133,12 @@ if not os.environ.get('BST_ARTIFACTS_ONLY', ''): 'bst = buildstream._frontend:cli' ] +_version_template = """\ +# coding: utf-8 +# file generated by setuptools_scm +# don't change, don't track in version control +__version__ = {version!r} +""" ##################################################### # Monkey-patching setuptools for performance # @@ -176,7 +182,10 @@ ScriptWriter.get_args = get_args setup(name='BuildStream', description='A framework for modelling build pipelines in YAML', license='LGPL', - use_scm_version=True, + use_scm_version={ + 'write_to': "buildstream/__version__.py", + 'write_to_template': _version_template, + }, packages=find_packages(), package_data={'buildstream': ['plugins/*/*.py', 'plugins/*/*.yaml', 'data/*.yaml', 'data/*.sh.in']}, |