Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GitLab API Experiments
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karl Fogel
GitLab API Experiments
Commits
c42fe743
Commit
c42fe743
authored
4 months ago
by
Karl Fogel
Browse files
Options
Downloads
Patches
Plain Diff
Give useful error if 'python-gitlab' not found
parent
31126a82
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gl-sak
+21
-11
21 additions, 11 deletions
gl-sak
with
21 additions
and
11 deletions
gl-sak
+
21
−
11
View file @
c42fe743
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment