| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9f256a7 commit 00ab7d0
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,11 +28,12 @@ | |||
| 28 | 28 | import six | |
| 29 | 29 | ||
| 30 | 30 | import gitlab.config | |
| 31 | + import gitlab.version | ||
| 31 | 32 | from gitlab.exceptions import * # noqa | |
| 32 | 33 | from gitlab.objects import * # noqa | |
| 33 | 34 | ||
| 34 | 35 | __title__ = 'python-gitlab' | |
| 35 | - __version__ = '0.11.1' | ||
| 36 | + __version__ = gitlab.version.version | ||
| 36 | 37 | __author__ = 'Gauvain Pocentek' | |
| 37 | 38 | __email__ = 'gauvain@pocentek.net' | |
| 38 | 39 | __license__ = 'LGPL3' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -240,8 +240,14 @@ def do_project_owned(gl, what, args): | |||
| 240 | 240 | ||
| 241 | 241 | ||
| 242 | 242 | def main(): | |
| 243 | + if "--version" in sys.argv: | ||
| 244 | + print(gitlab.__version__) | ||
| 245 | + exit(0) | ||
| 246 | + | ||
| 243 | 247 | parser = argparse.ArgumentParser( | |
| 244 | 248 | description="GitLab API Command Line Interface") | |
| 249 | + parser.add_argument("--version", help="Display the version.", | ||
| 250 | + action="store_true") | ||
| 245 | 251 | parser.add_argument("-v", "--verbose", "--fancy", | |
| 246 | 252 | help="Verbose mode", | |
| 247 | 253 | action="store_true") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + version = '0.11.1' | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,17 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | 4 | from setuptools import setup | |
| 5 | 5 | from setuptools import find_packages | |
| 6 | - | ||
| 7 | - | ||
| 8 | - def get_version(): | ||
| 9 | - with open('gitlab/__init__.py') as f: | ||
| 10 | - for line in f: | ||
| 11 | - if line.startswith('__version__'): | ||
| 12 | - return eval(line.split('=')[-1]) | ||
| 6 | + import gitlab.version | ||
| 13 | 7 | ||
| 14 | 8 | ||
| 15 | 9 | setup(name='python-gitlab', | |
| 16 | - version=get_version(), | ||
| 10 | + version=gitlab.version.version, | ||
| 17 | 11 | description='Interact with GitLab API', | |
| 18 | 12 | long_description='Interact with GitLab API', | |
| 19 | 13 | author='Gauvain Pocentek', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments