8000 merge: upstream · python-gitlab/python-gitlab@2ee4155 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ee4155

Browse files
committed
merge: upstream
2 parents 912f622 + aa13214 commit 2ee4155

File tree

112 files changed

+9099
-6900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+9099
-6900
lines changed

.github/workflows/docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
PY_COLORS: 1
13+
14+
jobs:
15+
10000 sphinx:
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.9
23+
- name: Install dependencies
24+
run: pip install tox
25+
- name: Build docs
26+
env:
27+
TOXENV: docs
28+
run: tox
29+
30+
twine-check:
31+
runs-on: ubuntu-20.04
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: Set up Python
35+
uses: actions/setup-python@v2
36+
with:
37+
python-version: 3.9
38+
- name: Install dependencies
39+
run: pip install tox twine wheel
40+
- name: Check twine readme rendering
41+
env:
42+
TOXENV: twine-check
43+
run: |
44+
python3 setup.py sdist bdist_wheel
45+
tox

.github/workflows/lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
PY_COLORS: 1
13+
14+
jobs:
15+
black:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-python@v2
20+
- uses: psf/black@stable
21+
with:
22+
black_args: ". --check"
23+
commitlint:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
- uses: wagoid/commitlint-github-action@v3
30+
31+
mypy:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: actions/setup-python@v2
36+
- run: pip install --upgrade tox
37+
- run: tox -e mypy

.github/workflows/test.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
PY_COLORS: 1
13+
14+
jobs:
15+
unit:
16+
runs-on: ubuntu-20.04
17+
strategy:
18+
matrix:
19+
include:
20+
- python-version: 3.6
21+
toxenv: py36
22+
- python-version: 3.7
23+
toxenv: py37
24+
- python-version: 3.8
25+
toxenv: py38
26+
- python-version: 3.9
27+
toxenv: py39
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v2
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install dependencies
35+
run: pip install tox pytest-github-actions-annotate-failures
36+
- name: Run tests
37+
env:
38+
TOXENV: ${{ matrix.toxenv }}
39+
run: tox
40+
41+
functional:
42+
runs-on: ubuntu-20.04
43+
strategy:
44+
matrix:
45+
toxenv: [py_func_v4, cli_func_v4]
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Set up Python
49+
uses: actions/setup-python@v2
50+
with:
51+
python-version: 3.9
52+
- name: Install dependencies
53+
run: pip install tox pytest-github-actions-annotate-failures
54+
- name: Run tests
55+
env:
56+
TOXENV: ${{ matrix.toxenv }}
57+
run: tox
58+
59+
coverage:
60+
runs-on: ubuntu-20.04
61+
steps:
62+
- uses: actions/checkout@v2
63+
- name: Set up Python ${{ matrix.python-version }}
64+
uses: actions/setup-python@v2
65+
with:
66+
python-version: 3.9
67+
- name: Install dependencies
68+
run: pip install tox pytest-github-actions-annotate-failures
69+
- name: Run tests
70+
env:
71+
PY_COLORS: 1
72+
TOXENV: cover
73+
run: tox
74+
- name: Upload codecov coverage
75+
uses: codecov/codecov-action@v1
76+
with:
77+
files: ./coverage.xml
78+
flags: unit
79+
fail_ci_if_error: true

.mypy.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mypy]
2+
files = gitlab/*.py
3+
4+
# disallow_incomplete_defs: This flag reports an error whenever it encounters a
5+
# partly annotated function definition.
6+
disallow_incomplete_defs = True

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ repos:
88
- id: black
99

1010
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
11-
rev: v3.0.0
11+
rev: v4.1.0
1212
hooks:
1313
- id: commitlint
1414
additional_dependencies: ['@commitlint/config-conventional']
1515
stages: [commit-msg]
1616

1717
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
18-
rev: v3.0.0
18+
rev: v4.1.0
1919
hooks:
2020
- id: commitlint-travis
2121
additional_dependencies: ['@commitlint/config-conventional']

.renovaterc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
],
55
"regexManagers": [
66
{
7-
"fileMatch": ["^.env$"],
7+
"fileMatch": ["^tools/functional/fixtures/.env$"],
88
"matchStrings": ["GITLAB_TAG=(?<currentValue>.*?)\n"],
99
"depNameTemplate": "gitlab/gitlab-ce",
1010
"datasourceTemplate": "docker",

.travis.yml

Lines changed: 0 additions & 108 deletions
This file was deleted.

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.. image:: https://travis-ci.org/python-gitlab/python-gitlab.svg?branch=master
2-
:target: https://travis-ci.org/python-gitlab/python-gitlab
1+
.. image:: https://github.com/python-gitlab/python-gitlab/workflows/Test/badge.svg
2+
:target: https://github.com/python-gitlab/python-gitlab/actions
33

44
.. image:: https://badge.fury.io/py/python-gitlab.svg
55
:target: https://badge.fury.io/py/python-gitlab
@@ -73,6 +73,11 @@ Bug reports
7373
Please report bugs and feature requests at
7474
https://github.com/python-gitlab/python-gitlab/issues.
7575

76+
Gitter Community Chat
77+
=====================
78+
79+
There is a `gitter <https://gitter.im/python-gitlab/Lobby>`_ community chat
80+
available at https://gitter.im/python-gitlab/Lobby
7681

7782
Documentation
7883
=============

docker-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-r requirements.txt
22
-r test-requirements.txt
3+
docker-compose==1.28.5 # prevent inconsistent .env behavior from system install
34
pytest-console-scripts
45
pytest-docker

docs/api-objects.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ API examples
3737
gl_objects/pipelines_and_jobs
3838
gl_objects/projects
3939
gl_objects/protected_branches
40+
gl_objects/releases
4041
gl_objects/runners
4142
gl_objects/remote_mirrors
4243
gl_objects/repositories

docs/api-usage.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ To connect to a GitLab server, create a ``gitlab.Gitlab`` object:
2626
# anonymous gitlab instance, read-only for public resources
2727
gl = gitlab.Gitlab('http://10.0.0.1')
2828
29+
# Define your own custom user agent for requests
30+
gl = gitlab.Gitlab('http://10.0.0.1', user_agent='my-package/1.0.0')
31+
2932
# make an API request to create the gl.user object. This is mandatory if you
3033
# use the username/password authentication.
3134
gl.auth()

docs/cli-usage.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ parameters. You can override the values in each GitLab server section.
7878
- Integer between 1 and 100
7979
- The number of items to return in listing queries. GitLab limits the
8080
value at 100.
81+
* - ``user_agent``
82+
- ``str``
83+
- A string defining a custom user agent to use when ``gitlab`` makes requests.
8184

8285
You must define the ``url`` in each GitLab server section.
8386

@@ -98,23 +101,24 @@ server, with very limited permissions.
98101
* - ``url``
99102
- URL for the GitLab server
100103
* - ``private_token``
101-
- Your user token. Login/password is not supported. Refer to `the official
102-
documentation`_pat to learn how to obtain a token.
104+
- Your user token. Login/password is not supported. Refer to `the
105+
official documentation
106+
<https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html>`__
107+
to learn how to obtain a token.
103108
* - ``oauth_token``
104109
- An Oauth token for authentication. The Gitlab server must be configured
105110
to support this authentication method.
106111
* - ``job_token``
107-
- Your job token. See `the official documentation`_job-token to learn how to obtain a token.
112+
- Your job token. See `the official documentation
113+
<https://docs.gitlab.com/ce/api/jobs.html#get-job-artifacts>`__
114+
to learn how to obtain a token.
108115
* - ``api_version``
109116
- GitLab API version to use. Only ``4`` is available since 1.5.0.
110117
* - ``http_username``
111118
- Username for optional HTTP authentication
112119
* - ``http_password``
113120
- Password for optional HTTP authentication
114121

115-
.. _pat: https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html
116-
.. _job-token: https://docs.gitlab.com/ce/api/jobs.html#get-job-artifacts
117-
118122
CLI
119123
===
120124

@@ -263,7 +267,7 @@ Delete a specific project package by id:
263267
264268
$ gitlab -v project-package delete --id 1 --project-id 3
265269
266-
Get a list of snippets for this project:
17AE
270+
Get a list of issues for this project:
267271

268272
.. code-block:: console
269273

0 commit comments

Comments
 (0)
0