Hello community,
here is the log from the commit of package python-python-gitlab for
openSUSE:Factory checked in at 2019-05-13 14:50:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-gitlab (Old)
and /work/SRC/openSUSE:Factory/.python-python-gitlab.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-gitlab"
Mon May 13 14:50:00 2019 rev:4 rq:701750 version:1.8.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-gitlab/python-python-gitlab.changes
2019-01-08 12:29:18.300218043 +0100
+++
/work/SRC/openSUSE:Factory/.python-python-gitlab.new.5148/python-python-gitlab.changes
2019-05-13 14:50:03.094714919 +0200
@@ -1,0 +2,12 @@
+Thu May 9 06:22:28 UTC 2019 - [email protected]
+
+- version update to 1.8.0
+ * fix(api): make reset_time_estimate() work again
+ * fix: handle empty 'Retry-After' header from GitLab
+ * fix: remove decode() on error_message string
+ * fix(api): avoid parameter conflicts with python and gitlab
+ * fix(api): Don't try to parse raw downloads
+ * feat: Added approve & unapprove method for Mergerequests
+ * fix all kwarg behaviour
+
+-------------------------------------------------------------------
Old:
----
python-gitlab-1.7.0.tar.gz
New:
----
python-gitlab-1.8.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-gitlab.spec ++++++
--- /var/tmp/diff_new_pack.IgEcab/_old 2019-05-13 14:50:03.730716521 +0200
+++ /var/tmp/diff_new_pack.IgEcab/_new 2019-05-13 14:50:03.734716531 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-python-gitlab
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-gitlab
-Version: 1.7.0
+Version: 1.8.0
Release: 0
Summary: Python module for interacting with the GitLab API
License: LGPL-3.0-only
@@ -35,6 +35,7 @@
BuildRequires: %{python_module six}
# /SECTION
Requires: python-requests >= 2.4.2
+Requires: python-setuptools
Requires: python-six
BuildArch: noarch
++++++ python-gitlab-1.7.0.tar.gz -> python-gitlab-1.8.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/.travis.yml
new/python-gitlab-1.8.0/.travis.yml
--- old/python-gitlab-1.7.0/.travis.yml 2018-06-11 21:17:48.000000000 +0200
+++ new/python-gitlab-1.8.0/.travis.yml 2019-02-22 10:07:24.000000000 +0100
@@ -21,3 +21,12 @@
- pip install tox
script:
- tox -e $TOX_ENV
+
+deploy:
+ provider: pypi
+ user: max-wittig
+ password:
+ secure:
LmNkZdbNe1oBSJ/PeTCKXaeu9Ml/biY4ZN4aedbD4lLXbxV/sgsHEE4N1Xrg2D/CJsnNjBY7CHzO0vL5iak8IRpV61xkdquZHvAUQKuhjMY30HopReAEw8sP+Wpf3lYcD1BjC5KT9vqWG99feoQ6epRt//Xm4DdkBYNmmUsCsMBTZLlGnj3B/mE8w+XQxQpdA2QzpRJ549N12vidwZRKqP0Zuug3rELVSo64O2bpqarKx/EeUUhTXZ0Y4XeVYgvuHBjvPqtuSJzR17CNkjaBhacD7EFTP34sAaCKGRDpfYiiiGx9LeKOEAv5Hj0+LOqEC/o6EyiIFviE+HvLQ/kBLJ6Oo2p47fibyIU/YOAFdZYKmBRq2ZUaV0DhhuuCRPZ+yLrsuaFRrKTVEMsHVtdsXJkW5gKG08vwOndW+kamppRhkAcdFVyokIgu/6nPBRWMuS6ue2aKoKRdP2gmqk0daKM1ao2uv06A2/J1/xkPy1EX5MjyK8Mh78ooKjITp5DHYn8l1pxaB0YcEkRzfwMyLErGQaRDgo7rCOm0tTRNhArkn0VE1/KLKFbATo2NSxZDwUJQ5TBNCEqfdBN1VzNEduJ7ajbZpq3DsBRM/9hzQ5LLxn7azMl9m+WmT12Qcgz25wg2Sgbs9Z2rT6fto5h8GSLpy8ReHo+S6fALJBzA4pg=
+ distributions: sdist bdist_wheel
+ on:
+ tags: true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/ChangeLog.rst
new/python-gitlab-1.8.0/ChangeLog.rst
--- old/python-gitlab-1.7.0/ChangeLog.rst 2018-12-09 10:18:50.000000000
+0100
+++ new/python-gitlab-1.8.0/ChangeLog.rst 2019-02-22 10:07:24.000000000
+0100
@@ -1,6 +1,20 @@
ChangeLog
=========
+Version 1.8.0_ - 2019-02-22
+---------------------------
+
+* docs(setup): use proper readme on PyPI
+* docs(readme): provide commit message guidelines
+* fix(api): make reset_time_estimate() work again
+* fix: handle empty 'Retry-After' header from GitLab
+* fix: remove decode() on error_message string
+* chore: release tags to PyPI automatically
+* fix(api): avoid parameter conflicts with python and gitlab
+* fix(api): Don't try to parse raw downloads
+* feat: Added approve & unapprove method for Mergerequests
+* fix all kwarg behaviour
+
Version 1.7.0_ - 2018-12-09
---------------------------
@@ -685,6 +699,7 @@
* Initial release
+.. _1.8.0: https://github.com/python-gitlab/python-gitlab/compare/1.7.0...1.8.0
.. _1.7.0: https://github.com/python-gitlab/python-gitlab/compare/1.6.0...1.7.0
.. _1.6.0: https://github.com/python-gitlab/python-gitlab/compare/1.5.1...1.6.0
.. _1.5.1: https://github.com/python-gitlab/python-gitlab/compare/1.5.0...1.5.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/PKG-INFO
new/python-gitlab-1.8.0/PKG-INFO
--- old/python-gitlab-1.7.0/PKG-INFO 2018-12-09 10:35:11.000000000 +0100
+++ new/python-gitlab-1.8.0/PKG-INFO 2019-02-22 10:08:06.000000000 +0100
@@ -1,12 +1,163 @@
Metadata-Version: 1.1
Name: python-gitlab
-Version: 1.7.0
+Version: 1.8.0
Summary: Interact with GitLab API
Home-page: https://github.com/python-gitlab/python-gitlab
Author: Gauvain Pocentek
Author-email: [email protected]
License: LGPLv3
-Description: Interact with GitLab API
+Description: .. image::
https://travis-ci.org/python-gitlab/python-gitlab.svg?branch=master
+ :target: https://travis-ci.org/python-gitlab/python-gitlab
+
+ .. image:: https://badge.fury.io/py/python-gitlab.svg
+ :target: https://badge.fury.io/py/python-gitlab
+
+ .. image::
https://readthedocs.org/projects/python-gitlab/badge/?version=latest
+ :target:
https://python-gitlab.readthedocs.org/en/latest/?badge=latest
+
+ .. image:: https://img.shields.io/pypi/pyversions/python-gitlab.svg
+ :target: https://pypi.python.org/pypi/python-gitlab
+
+ .. image:: https://img.shields.io/gitter/room/python-gitlab/Lobby.svg
+ :target: https://gitter.im/python-gitlab/Lobby
+
+ Python GitLab
+ =============
+
+ ``python-gitlab`` is a Python package providing access to the GitLab
server API.
+
+ It supports the v4 API of GitLab, and provides a CLI tool (``gitlab``).
+
+ Installation
+ ============
+
+ Requirements
+ ------------
+
+ python-gitlab depends on:
+
+ * `python-requests <http://docs.python-requests.org/en/latest/>`_
+ * `six <https://pythonhosted.org/six/>`_
+
+ Install with pip
+ ----------------
+
+ .. code-block:: console
+
+ pip install python-gitlab
+
+
+ Using the python-gitlab docker image
+ ====================================
+
+ How to build
+ ------------
+
+ ``docker build -t python-gitlab:TAG .``
+
+ How to use
+ ----------
+
+ ``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v
/path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...``
+
+ To change the GitLab URL, use `-e GITLAB_URL=<your url>`
+
+
+ Bring your own config file:
+ ``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg
-e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...``
+
+
+ Bug reports
+ ===========
+
+ Please report bugs and feature requests at
+ https://github.com/python-gitlab/python-gitlab/issues.
+
+
+ Documentation
+ =============
+
+ The full documentation for CLI and API is available on `readthedocs
+ <http://python-gitlab.readthedocs.org/en/stable/>`_.
+
+ Build the docs
+ --------------
+ You can build the documentation using ``sphinx``::
+
+ pip install sphinx
+ python setup.py build_sphinx
+
+
+ Contributing
+ ============
+
+ You can contribute to the project in multiple ways:
+
+ * Write documentation
+ * Implement features
+ * Fix bugs
+ * Add unit and functional tests
+ * Everything else you can think of
+
+ We prefer commit messages to be formatted using the
`conventional-changelog
<https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines>`_.
+ This leads to more readable messages that are easy to follow when
looking through the project history.
+
+ Provide your patches as github pull requests. Thanks!
+
+ Running unit tests
+ ------------------
+
+ Before submitting a pull request make sure that the tests still
succeed with
+ your change. Unit tests and functional tests run using the travis
service and
+ passing tests are mandatory to get merge requests accepted.
+
+ You need to install ``tox`` to run unit tests and documentation builds
locally:
+
+ .. code-block:: bash
+
+ # run the unit tests for python 2/3, and the pep8 tests:
+ tox
+
+ # run tests in one environment only:
+ tox -epy35
+
+ # build the documentation, the result will be generated in
+ # build/sphinx/html/
+ tox -edocs
+
+ Running integration tests
+ -------------------------
+
+ Two scripts run tests against a running gitlab instance, using a docker
+ container. You need to have docker installed on the test machine, and
your user
+ must have the correct permissions to talk to the docker daemon.
+
+ To run these tests:
+
+ .. code-block:: bash
+
+ # run the CLI tests:
+ ./tools/functional_tests.sh
+
+ # run the python API tests:
+ ./tools/py_functional_tests.sh
+
+ You can also build a test environment using the following command:
+
+ .. code-block:: bash
+
+ ./tools/build_test_env.sh
+
+ A freshly configured gitlab container will be available at
+ http://localhost:8080 (login ``root`` / password ``5iveL!fe``). A
configuration
+ for python-gitlab will be written in ``/tmp/python-gitlab.cfg``.
+
+ To cleanup the environment delete the container:
+
+ .. code-block:: bash
+
+ docker rm -f gitlab-test
+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/README.rst
new/python-gitlab-1.8.0/README.rst
--- old/python-gitlab-1.7.0/README.rst 2018-11-04 16:47:54.000000000 +0100
+++ new/python-gitlab-1.8.0/README.rst 2019-02-22 10:07:24.000000000 +0100
@@ -91,6 +91,9 @@
* Add unit and functional tests
* Everything else you can think of
+We prefer commit messages to be formatted using the `conventional-changelog
<https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines>`_.
+This leads to more readable messages that are easy to follow when looking
through the project history.
+
Provide your patches as github pull requests. Thanks!
Running unit tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/RELEASE_NOTES.rst
new/python-gitlab-1.8.0/RELEASE_NOTES.rst
--- old/python-gitlab-1.7.0/RELEASE_NOTES.rst 2018-08-25 16:36:44.000000000
+0200
+++ new/python-gitlab-1.8.0/RELEASE_NOTES.rst 2019-02-22 10:07:24.000000000
+0100
@@ -4,6 +4,27 @@
This page describes important changes between python-gitlab releases.
+Changes from 1.7 to 1.8
+=======================
+
+* You can now use the ``query_parameters`` argument in method calls to define
+ arguments to send to the GitLab server. This allows to avoid conflicts
+ between python-gitlab and GitLab server variables, and allows to use the
+ python reserved keywords as GitLab arguments.
+
+ The following examples make the same GitLab request with the 2 syntaxes::
+
+ projects = gl.projects.list(owned=True, starred=True)
+ projects = gl.projects.list(query_parameters={'owned': True, 'starred':
True})
+
+ The following example only works with the new parameter::
+
+ activities = gl.user_activities.list(
+ query_parameters={'from': '2019-01-01'},
+ all=True)
+
+* Additionally the ``all`` paremeter is not sent to the GitLab anymore.
+
Changes from 1.5 to 1.6
=======================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/docs/api-usage.rst
new/python-gitlab-1.8.0/docs/api-usage.rst
--- old/python-gitlab-1.7.0/docs/api-usage.rst 2018-09-05 18:03:57.000000000
+0200
+++ new/python-gitlab-1.8.0/docs/api-usage.rst 2019-02-22 10:07:24.000000000
+0100
@@ -118,6 +118,25 @@
project = gl.projects.get(1)
issues = project.issues.list()
+python-gitlab allows to send any data to the GitLab server when making queries.
+In case of invalid or missing arguments python-gitlab will raise an exception
+with the GitLab server error message:
+
+.. code-block:: python
+
+ >>> gl.projects.list(sort='invalid value')
+ ...
+ GitlabListError: 400: sort does not have a valid value
+
+You can use the ``query_parameters`` argument to send arguments that would
+conflict with python or python-gitlab when using them as kwargs:
+
+.. code-block:: python
+
+ gl.user_activities.list(from='2019-01-01') ## invalid
+
+ gl.user_activities.list(query_parameters={'from': '2019-01-01'}) # OK
+
Gitlab Objects
==============
@@ -299,7 +318,9 @@
python-gitlab obeys the rate limit of the GitLab server by default. On
receiving a 429 response (Too Many Requests), python-gitlab sleeps for the
-amount of time in the Retry-After header that GitLab sends back.
+amount of time in the Retry-After header that GitLab sends back. If GitLab
+does not return a response with the Retry-After header, python-gitlab will
+perform an exponential backoff.
If you don't want to wait, you can disable the rate-limiting feature, by
supplying the ``obey_rate_limit`` argument.
@@ -312,6 +333,18 @@
gl = gitlab.gitlab(url, token, api_version=4)
gl.projects.list(all=True, obey_rate_limit=False)
+If you do not disable the rate-limiting feature, you can supply a custom value
+for ``max_retries``; by default, this is set to 10. To retry without bound when
+throttled, you can set this parameter to -1. This parameter is ignored if
+``obey_rate_limit`` is set to ``False``.
+
+.. code-block:: python
+
+ import gitlab
+ import requests
+
+ gl = gitlab.gitlab(url, token, api_version=4)
+ gl.projects.list(all=True, max_retries=12)
.. warning::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/docs/gl_objects/commits.rst
new/python-gitlab-1.8.0/docs/gl_objects/commits.rst
--- old/python-gitlab-1.7.0/docs/gl_objects/commits.rst 2018-08-25
15:35:19.000000000 +0200
+++ new/python-gitlab-1.8.0/docs/gl_objects/commits.rst 2019-02-22
10:07:24.000000000 +0100
@@ -27,6 +27,14 @@
commits = project.commits.list(ref_name='my_branch')
commits = project.commits.list(since='2016-01-01T00:00:00Z')
+.. note::
+
+ The available ``all`` listing argument conflicts with the python-gitlab
+ argument. Use ``query_parameters`` to avoid the conflict::
+
+ commits = project.commits.list(all=True,
+ query_parameters={'ref_name':
'my_branch'})
+
Create a commit::
# See
https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/docs/gl_objects/users.rst
new/python-gitlab-1.8.0/docs/gl_objects/users.rst
--- old/python-gitlab-1.7.0/docs/gl_objects/users.rst 2018-11-24
16:54:58.000000000 +0100
+++ new/python-gitlab-1.8.0/docs/gl_objects/users.rst 2019-02-22
10:07:24.000000000 +0100
@@ -312,4 +312,6 @@
Get the users activities::
- activities = gl.user_activities.list(all=True, as_list=False)
+ activities = gl.user_activities.list(
+ query_parameters={'from': '2018-07-01'},
+ all=True, as_list=False)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/gitlab/__init__.py
new/python-gitlab-1.8.0/gitlab/__init__.py
--- old/python-gitlab-1.7.0/gitlab/__init__.py 2018-12-09 10:18:50.000000000
+0100
+++ new/python-gitlab-1.8.0/gitlab/__init__.py 2019-02-22 10:07:24.000000000
+0100
@@ -31,11 +31,11 @@
from gitlab import utils # noqa
__title__ = 'python-gitlab'
-__version__ = '1.7.0'
+__version__ = '1.8.0'
__author__ = 'Gauvain Pocentek'
-__email__ = '[email protected]'
+__email__ = '[email protected]'
__license__ = 'LGPL3'
-__copyright__ = 'Copyright 2013-2018 Gauvain Pocentek'
+__copyright__ = 'Copyright 2013-2019 Gauvain Pocentek'
warnings.filterwarnings('default', category=DeprecationWarning,
module='^gitlab')
@@ -445,7 +445,20 @@
params = {}
utils.copy_dict(params, query_data)
- utils.copy_dict(params, kwargs)
+
+ # Deal with kwargs: by default a user uses kwargs to send data to the
+ # gitlab server, but this generates problems (python keyword conflicts
+ # and python-gitlab/gitlab conflicts).
+ # So we provide a `query_parameters` key: if it's there we use its dict
+ # value as arguments for the gitlab server, and ignore the other
+ # arguments, except pagination ones (per_page and page)
+ if 'query_parameters' in kwargs:
+ utils.copy_dict(params, kwargs['query_parameters'])
+ for arg in ('per_page', 'page'):
+ if arg in kwargs:
+ params[arg] = kwargs[arg]
+ else:
+ utils.copy_dict(params, kwargs)
opts = self._get_session_opts(content_type='application/json')
@@ -477,6 +490,10 @@
# obey the rate limit by default
obey_rate_limit = kwargs.get("obey_rate_limit", True)
+ # set max_retries to 10 by default, disable by setting it to -1
+ max_retries = kwargs.get("max_retries", 10)
+ cur_retries = 0
+
while True:
result = self.session.send(prepped, timeout=timeout, **settings)
@@ -486,9 +503,13 @@
return result
if 429 == result.status_code and obey_rate_limit:
- wait_time = int(result.headers["Retry-After"])
- time.sleep(wait_time)
- continue
+ if max_retries == -1 or cur_retries < max_retries:
+ wait_time = 2 ** cur_retries * 0.1
+ if "Retry-After" in result.headers:
+ wait_time = int(result.headers["Retry-After"])
+ cur_retries += 1
+ time.sleep(wait_time)
+ continue
error_message = result.content
try:
@@ -509,7 +530,8 @@
error_message=error_message,
response_body=result.content)
- def http_get(self, path, query_data={}, streamed=False, **kwargs):
+ def http_get(self, path, query_data={}, streamed=False, raw=False,
+ **kwargs):
"""Make a GET request to the Gitlab server.
Args:
@@ -517,6 +539,7 @@
'http://whatever/v4/api/projecs')
query_data (dict): Data to send as query parameters
streamed (bool): Whether the data should be streamed
+ raw (bool): If True do not try to parse the output as json
**kwargs: Extra options to send to the server (e.g. sudo)
Returns:
@@ -530,8 +553,10 @@
"""
result = self.http_request('get', path, query_data=query_data,
streamed=streamed, **kwargs)
- if (result.headers['Content-Type'] == 'application/json' and
- not streamed):
+
+ if (result.headers['Content-Type'] == 'application/json'
+ and not streamed
+ and not raw):
try:
return result.json()
except Exception:
@@ -565,7 +590,7 @@
# In case we want to change the default behavior at some point
as_list = True if as_list is None else as_list
- get_all = kwargs.get('all', False)
+ get_all = kwargs.pop('all', False)
url = self._build_url(path)
if get_all is True:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/gitlab/exceptions.py
new/python-gitlab-1.8.0/gitlab/exceptions.py
--- old/python-gitlab-1.7.0/gitlab/exceptions.py 2018-12-09
09:26:16.000000000 +0100
+++ new/python-gitlab-1.8.0/gitlab/exceptions.py 2019-02-22
10:07:24.000000000 +0100
@@ -170,6 +170,10 @@
pass
+class GitlabMRApprovalError(GitlabOperationError):
+ pass
+
+
class GitlabMRClosedError(GitlabOperationError):
pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/gitlab/mixins.py
new/python-gitlab-1.8.0/gitlab/mixins.py
--- old/python-gitlab-1.7.0/gitlab/mixins.py 2018-06-17 16:50:06.000000000
+0200
+++ new/python-gitlab-1.8.0/gitlab/mixins.py 2019-02-22 10:07:24.000000000
+0100
@@ -532,7 +532,7 @@
GitlabAuthenticationError: If authentication is not correct
GitlabTimeTrackingError: If the time tracking update cannot be done
"""
- path = '%s/%s/rest_time_estimate' % (self.manager.path, self.get_id())
+ path = '%s/%s/reset_time_estimate' % (self.manager.path, self.get_id())
return self.manager.gitlab.http_post(path, **kwargs)
@cli.register_custom_action(('ProjectIssue', 'ProjectMergeRequest'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/gitlab/v4/objects.py
new/python-gitlab-1.8.0/gitlab/v4/objects.py
--- old/python-gitlab-1.7.0/gitlab/v4/objects.py 2018-12-09
09:26:16.000000000 +0100
+++ new/python-gitlab-1.8.0/gitlab/v4/objects.py 2019-02-22
10:07:24.000000000 +0100
@@ -1128,7 +1128,7 @@
"""
path = '/snippets/%s/raw' % self.get_id()
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@@ -1365,7 +1365,7 @@
"""
path = '%s/%s/artifacts' % (self.manager.path, self.get_id())
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@cli.register_custom_action('ProjectJob')
@@ -1393,7 +1393,7 @@
"""
path = '%s/%s/artifacts/%s' % (self.manager.path, self.get_id(), path)
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@cli.register_custom_action('ProjectJob')
@@ -1419,7 +1419,7 @@
"""
path = '%s/%s/trace' % (self.manager.path, self.get_id())
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@@ -2292,9 +2292,51 @@
Returns:
RESTObjectList: List of changes
"""
+
path = '%s/%s/pipelines' % (self.manager.path, self.get_id())
return self.manager.gitlab.http_get(path, **kwargs)
+ @cli.register_custom_action('ProjectMergeRequest', tuple(), ('sha'))
+ @exc.on_http_error(exc.GitlabMRApprovalError)
+ def approve(self, sha=None, **kwargs):
+ """Approve the merge request.
+
+ Args:
+ sha (str): Head SHA of MR
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabMRApprovalError: If the approval failed
+ """
+ path = '%s/%s/approve' % (self.manager.path, self.get_id())
+ data = {}
+ if sha:
+ data['sha'] = sha
+
+ server_data = self.manager.gitlab.http_post(path, post_data=data,
+ **kwargs)
+ self._update_attrs(server_data)
+
+ @cli.register_custom_action('ProjectMergeRequest')
+ @exc.on_http_error(exc.GitlabMRApprovalError)
+ def unapprove(self, **kwargs):
+ """Unapprove the merge request.
+
+ Args:
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabMRApprovalError: If the unapproval failed
+ """
+ path = '%s/%s/unapprove' % (self.manager.path, self.get_id())
+ data = {}
+
+ server_data = self.manager.gitlab.http_post(path, post_data=data,
+ **kwargs)
+ self._update_attrs(server_data)
+
@cli.register_custom_action('ProjectMergeRequest', tuple(),
('merge_commit_message',
'should_remove_source_branch',
@@ -2654,7 +2696,7 @@
path = '%s/%s/raw' % (self.path, file_path)
query_data = {'ref': ref}
result = self.gitlab.http_get(path, query_data=query_data,
- streamed=streamed, **kwargs)
+ streamed=streamed, raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@@ -2897,7 +2939,7 @@
"""
path = "%s/%s/raw" % (self.manager.path, self.get_id())
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@@ -3174,7 +3216,7 @@
"""
path = '/projects/%d/export/download' % self.project_id
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@@ -3315,7 +3357,7 @@
"""
path = '/projects/%s/repository/blobs/%s/raw' % (self.get_id(), sha)
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@cli.register_custom_action('Project', ('from_', 'to'))
@@ -3391,7 +3433,8 @@
if sha:
query_data['sha'] = sha
result = self.manager.gitlab.http_get(path, query_data=query_data,
- streamed=streamed, **kwargs)
+ raw=True, streamed=streamed,
+ **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@cli.register_custom_action('Project', ('forked_from_id', ))
@@ -3674,7 +3717,7 @@
"""
path = '/projects/%d/snapshot' % self.get_id()
result = self.manager.gitlab.http_get(path, streamed=streamed,
- **kwargs)
+ raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
@cli.register_custom_action('Project', ('scope', 'search'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/python_gitlab.egg-info/PKG-INFO
new/python-gitlab-1.8.0/python_gitlab.egg-info/PKG-INFO
--- old/python-gitlab-1.7.0/python_gitlab.egg-info/PKG-INFO 2018-12-09
10:35:11.000000000 +0100
+++ new/python-gitlab-1.8.0/python_gitlab.egg-info/PKG-INFO 2019-02-22
10:08:06.000000000 +0100
@@ -1,12 +1,163 @@
Metadata-Version: 1.1
Name: python-gitlab
-Version: 1.7.0
+Version: 1.8.0
Summary: Interact with GitLab API
Home-page: https://github.com/python-gitlab/python-gitlab
Author: Gauvain Pocentek
Author-email: [email protected]
License: LGPLv3
-Description: Interact with GitLab API
+Description: .. image::
https://travis-ci.org/python-gitlab/python-gitlab.svg?branch=master
+ :target: https://travis-ci.org/python-gitlab/python-gitlab
+
+ .. image:: https://badge.fury.io/py/python-gitlab.svg
+ :target: https://badge.fury.io/py/python-gitlab
+
+ .. image::
https://readthedocs.org/projects/python-gitlab/badge/?version=latest
+ :target:
https://python-gitlab.readthedocs.org/en/latest/?badge=latest
+
+ .. image:: https://img.shields.io/pypi/pyversions/python-gitlab.svg
+ :target: https://pypi.python.org/pypi/python-gitlab
+
+ .. image:: https://img.shields.io/gitter/room/python-gitlab/Lobby.svg
+ :target: https://gitter.im/python-gitlab/Lobby
+
+ Python GitLab
+ =============
+
+ ``python-gitlab`` is a Python package providing access to the GitLab
server API.
+
+ It supports the v4 API of GitLab, and provides a CLI tool (``gitlab``).
+
+ Installation
+ ============
+
+ Requirements
+ ------------
+
+ python-gitlab depends on:
+
+ * `python-requests <http://docs.python-requests.org/en/latest/>`_
+ * `six <https://pythonhosted.org/six/>`_
+
+ Install with pip
+ ----------------
+
+ .. code-block:: console
+
+ pip install python-gitlab
+
+
+ Using the python-gitlab docker image
+ ====================================
+
+ How to build
+ ------------
+
+ ``docker build -t python-gitlab:TAG .``
+
+ How to use
+ ----------
+
+ ``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v
/path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...``
+
+ To change the GitLab URL, use `-e GITLAB_URL=<your url>`
+
+
+ Bring your own config file:
+ ``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg
-e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...``
+
+
+ Bug reports
+ ===========
+
+ Please report bugs and feature requests at
+ https://github.com/python-gitlab/python-gitlab/issues.
+
+
+ Documentation
+ =============
+
+ The full documentation for CLI and API is available on `readthedocs
+ <http://python-gitlab.readthedocs.org/en/stable/>`_.
+
+ Build the docs
+ --------------
+ You can build the documentation using ``sphinx``::
+
+ pip install sphinx
+ python setup.py build_sphinx
+
+
+ Contributing
+ ============
+
+ You can contribute to the project in multiple ways:
+
+ * Write documentation
+ * Implement features
+ * Fix bugs
+ * Add unit and functional tests
+ * Everything else you can think of
+
+ We prefer commit messages to be formatted using the
`conventional-changelog
<https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines>`_.
+ This leads to more readable messages that are easy to follow when
looking through the project history.
+
+ Provide your patches as github pull requests. Thanks!
+
+ Running unit tests
+ ------------------
+
+ Before submitting a pull request make sure that the tests still
succeed with
+ your change. Unit tests and functional tests run using the travis
service and
+ passing tests are mandatory to get merge requests accepted.
+
+ You need to install ``tox`` to run unit tests and documentation builds
locally:
+
+ .. code-block:: bash
+
+ # run the unit tests for python 2/3, and the pep8 tests:
+ tox
+
+ # run tests in one environment only:
+ tox -epy35
+
+ # build the documentation, the result will be generated in
+ # build/sphinx/html/
+ tox -edocs
+
+ Running integration tests
+ -------------------------
+
+ Two scripts run tests against a running gitlab instance, using a docker
+ container. You need to have docker installed on the test machine, and
your user
+ must have the correct permissions to talk to the docker daemon.
+
+ To run these tests:
+
+ .. code-block:: bash
+
+ # run the CLI tests:
+ ./tools/functional_tests.sh
+
+ # run the python API tests:
+ ./tools/py_functional_tests.sh
+
+ You can also build a test environment using the following command:
+
+ .. code-block:: bash
+
+ ./tools/build_test_env.sh
+
+ A freshly configured gitlab container will be available at
+ http://localhost:8080 (login ``root`` / password ``5iveL!fe``). A
configuration
+ for python-gitlab will be written in ``/tmp/python-gitlab.cfg``.
+
+ To cleanup the environment delete the container:
+
+ .. code-block:: bash
+
+ docker rm -f gitlab-test
+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/setup.py
new/python-gitlab-1.8.0/setup.py
--- old/python-gitlab-1.7.0/setup.py 2018-09-15 09:46:14.000000000 +0200
+++ new/python-gitlab-1.8.0/setup.py 2019-02-22 10:07:24.000000000 +0100
@@ -11,11 +11,13 @@
if line.startswith('__version__'):
return eval(line.split('=')[-1])
+with open("README.rst", "r") as readme_file:
+ readme = readme_file.read()
setup(name='python-gitlab',
version=get_version(),
description='Interact with GitLab API',
- long_description='Interact with GitLab API',
+ long_description=readme,
author='Gauvain Pocentek',
author_email='[email protected]',
license='LGPLv3',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-gitlab-1.7.0/tools/python_test_v4.py
new/python-gitlab-1.8.0/tools/python_test_v4.py
--- old/python-gitlab-1.7.0/tools/python_test_v4.py 2018-12-09
09:26:16.000000000 +0100
+++ new/python-gitlab-1.8.0/tools/python_test_v4.py 2019-02-22
10:07:24.000000000 +0100
@@ -773,7 +773,7 @@
assert(len(snippets) == 0)
# user activities
-gl.user_activities.list()
+gl.user_activities.list(query_parameters={'from': '2019-01-01'})
# events
gl.events.list()
@@ -798,7 +798,7 @@
except gitlab.GitlabCreateError as e:
error_message = e.error_message
break
-assert 'Retry later' in error_message.decode()
+assert 'Retry later' in error_message
[current_project.delete() for current_project in projects]
settings.throttle_authenticated_api_enabled = False
settings.save()