Skip to content
Snippets Groups Projects
Commit c42fe743 authored by Karl Fogel's avatar Karl Fogel
Browse files

Give useful error if 'python-gitlab' not found

parent 31126a82
No related branches found
No related tags found
No related merge requests found
......@@ -36,18 +36,28 @@ of your runtime environment, but if you are in any doubt, just use
'--authn-token-file' instead.
"""
# To get started:
#
# $ git clone git@gitlab.com:python-gitlab/python-gitlab.git
# $ cd python-gitlab
# $ python -m venv .venv
# $ source .venv/bin/activate
# venv$ pip install -e .
#
# See https://python-gitlab.readthedocs.io/en/stable/api-usage.html
import gitlab
import argparse
import sys
try:
import gitlab
except ImportError:
print("""ERROR: Python GitLab API bindings not found.
Please install 'python-gitlab' and make it available in your Python
run-time environment. This recipe should work for most people:
$ git clone git@gitlab.com:python-gitlab/python-gitlab.git
$ cd python-gitlab
$ python -m venv .venv
$ source .venv/bin/activate
venv$ pip install -e .
venv$ cd .../wherever/gl-sak/lives
venv$ ./gl-sak --help
(See https://python-gitlab.readthedocs.io/en/stable/api-usage.html
for more about the Python GitLab API package.)""")
sys.exit(1)
def main():
# Set up options and arguments
......
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