diff options
| author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2016-01-30 17:44:29 +0100 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2016-01-30 17:44:29 +0100 |
| commit | 00ab7d00a553e68eea5668dbf455404925fef6e0 (patch) | |
| tree | d4b958d09c96efb62af3b87886966bd3e1928e1b /gitlab | |
| parent | 9f256a71aa070bf28c70b2242976fbb0bc758bc4 (diff) | |
| download | gitlab-00ab7d00a553e68eea5668dbf455404925fef6e0.tar.gz | |
Rework the __version__ import
This simplifies the setup.py script
Also provide a --version option for CLI
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/__init__.py | 3 | ||||
| -rw-r--r-- | gitlab/cli.py | 6 | ||||
| -rw-r--r-- | gitlab/version.py | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 24d1882..018a18a 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -28,11 +28,12 @@ import requests import six import gitlab.config +import gitlab.version from gitlab.exceptions import * # noqa from gitlab.objects import * # noqa __title__ = 'python-gitlab' -__version__ = '0.11.1' +__version__ = gitlab.version.version __author__ = 'Gauvain Pocentek' __email__ = 'gauvain@pocentek.net' __license__ = 'LGPL3' diff --git a/gitlab/cli.py b/gitlab/cli.py index 7843423..7fa176c 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -240,8 +240,14 @@ def do_project_owned(gl, what, args): def main(): + if "--version" in sys.argv: + print(gitlab.__version__) + exit(0) + parser = argparse.ArgumentParser( description="GitLab API Command Line Interface") + parser.add_argument("--version", help="Display the version.", + action="store_true") parser.add_argument("-v", "--verbose", "--fancy", help="Verbose mode", action="store_true") diff --git a/gitlab/version.py b/gitlab/version.py new file mode 100644 index 0000000..d13acdd --- /dev/null +++ b/gitlab/version.py @@ -0,0 +1 @@ +version = '0.11.1' |
