-
Notifications
You must be signed in to change notification settings - Fork 12
/
__init__.py
43 lines (32 loc) · 1.11 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
"""
AutoBazaar top module.
AutoBazaar is an AutoML system created to execute the experiments associated with the
[The Machine Learning Bazaar Paper: Harnessing the ML Ecosystem for Effective System
Development](https://arxiv.org/pdf/1905.08942.pdf)
by the [Human-Data Interaction (HDI) Project](https://hdi-dai.lids.mit.edu/) at LIDS, MIT.
* Free software: MIT license
* Documentation: https://HDI-Project.github.io/AutoBazaar
"""
import os
import git
__author__ = 'MIT Data To AI Lab'
__copyright__ = 'Copyright (c) 2019, MIT Data To AI Lab'
__email__ = 'dailabmit@gmail.com'
__license__ = 'MIT'
__version__ = '0.2.1'
def _get_commit():
try:
base_path = os.path.dirname(__file__)
repo = git.Repo(base_path, search_parent_directories=True)
commit = repo.commit().hexsha[0:7]
if repo.is_dirty(untracked_files=False):
commit += '*'
return commit
except git.InvalidGitRepositoryError:
return None
def get_version():
commit = _get_commit()
if commit:
return '{} - {}'.format(__version__, commit)
return __version__