Skip to content

Commit 4df7015

Browse files
authored
Merge branch 'main' into cancel_invite
2 parents c5fc30d + 1e58753 commit 4df7015

File tree

12 files changed

+55
-69
lines changed

12 files changed

+55
-69
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,33 @@ jobs:
99
strategy:
1010
matrix:
1111
python:
12-
- { VERSION: "3.6", TOXENV: "py36", ALLOW_FAILURE: false }
1312
- { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false }
1413
- { VERSION: "3.8", TOXENV: "py38",ALLOW_FAILURE: false }
1514
- { VERSION: "3.9", TOXENV: "py39",ALLOW_FAILURE: false }
1615
- { VERSION: "3.10", TOXENV: "py310",ALLOW_FAILURE: false }
17-
- { VERSION: "3.9", TOXENV: "flake8,doclint,docs,commitlint", ALLOW_FAILURE: false }
18-
- { VERSION: "3.9", TOXENV: "docstrings", ALLOW_FAILURE: true}
19-
- { VERSION: "pypy3", TOXENV: "pypy", ALLOW_FAILURE: false }
16+
- { VERSION: "3.10", TOXENV: "flake8,doclint,docs,commitlint", ALLOW_FAILURE: false }
17+
- { VERSION: "3.10", TOXENV: "docstrings", ALLOW_FAILURE: true}
18+
- { VERSION: "pypy3.9", TOXENV: "pypy", ALLOW_FAILURE: false }
2019

2120
steps:
2221
- name: Check out the repository
23-
uses: actions/[email protected]
22+
uses: actions/checkout@v3
23+
2424
- name: Setup Python
25-
uses: actions/setup-python@v2.2.1
25+
uses: actions/setup-python@v4.2.0
2626
with:
2727
python-version: ${{ matrix.PYTHON.VERSION }}
28+
2829
- name: Upgrade pip
2930
run: |
3031
pip install --constraint=.github/workflows/constraints.txt pip
3132
pip --version
33+
3234
- name: Install Tox
3335
run: |
3436
pip install --constraint=.github/workflows/constraints.txt tox
3537
tox --version
38+
3639
- name: Run Tox
3740
run: tox
3841
env:

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ repos:
1414
types: [text]
1515
stages: [commit, push, manual]
1616
- repo: https://github.com/asottile/reorder_python_imports
17-
rev: v3.8.1
17+
rev: v3.8.2
1818
hooks:
1919
- id: reorder-python-imports
20-
args: [--application-directories, '.:src', --py36-plus]
20+
args: [--application-directories, '.:src', --py37-plus]
2121
- repo: https://github.com/psf/black
2222
rev: 22.6.0
2323
hooks:
2424
- id: black
2525
- repo: https://github.com/asottile/pyupgrade
26-
rev: v2.37.1
26+
rev: v2.37.3
2727
hooks:
2828
- id: pyupgrade
29-
args: [--py36-plus]
29+
args: [--py37-plus]
3030
#- repo: https://github.com/pre-commit/mirrors-mypy
3131
# rev: v0.910
3232
# hooks:
@@ -37,7 +37,7 @@ repos:
3737
hooks:
3838
- id: gitlint
3939
- repo: https://github.com/asottile/setup-cfg-fmt
40-
rev: v1.20.1
40+
rev: v2.0.0
4141
hooks:
4242
- id: setup-cfg-fmt
43-
args: [--min-py3-version, '3.6']
43+
args: [--min-py3-version, '3.7']

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,5 @@ Contributors
216216
- Philipp Heil (@zkdev)
217217

218218
- Petter Kvalvaag (@pettermk)
219+
220+
- Peter Küffner (@kuepe-sl)

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
github3.py is a comprehensive, actively developed, and extraordinarily stable
55
wrapper around the GitHub API (v3).
66

7-
Note: This library currently works with Python 3.6+ or pypy3. For older versions, please use version 1.3.0.
7+
Note: This library currently works with Python 3.7+ or pypy3. For older versions, please use version 1.3.0.
88

99
Installation
1010
------------

appveyor.yml

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

docs/source/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ The tests are generally run using tox. Tox can be installed like so
123123
124124
We test against PyPy3 and the following versions of Python:
125125

126-
- 3.6
127-
128126
- 3.7
129127

130128
- 3.8

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 78
3-
target-version = ['py36']
3+
target-version = ['py37']
44
safe = true
55
exclude = '''
66
(

setup.cfg

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ classifiers =
1717
Programming Language :: Python
1818
Programming Language :: Python :: 3
1919
Programming Language :: Python :: 3 :: Only
20-
Programming Language :: Python :: 3.6
21-
Programming Language :: Python :: 3.7
22-
Programming Language :: Python :: 3.8
23-
Programming Language :: Python :: 3.9
24-
Programming Language :: Python :: 3.10
2520
Programming Language :: Python :: Implementation :: CPython
2621
project_urls =
2722
Documentation = https://github3.readthedocs.io
@@ -41,8 +36,7 @@ install_requires =
4136
python-dateutil>=2.6.0
4237
requests>=2.18
4338
uritemplate>=3.0.0
44-
typing-extensions>=3.10.0.2;python_version < "3.7"
45-
python_requires = >=3.6
39+
python_requires = >=3.7
4640
package_dir =
4741
=src
4842

src/github3/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ def rate_limit(self):
19801980
def repositories(
19811981
self, type=None, sort=None, direction=None, number=-1, etag=None
19821982
):
1983-
"""List repositories for the authenticated user, filterable by ``type``.
1983+
"""List repositories for the authenticated user filterable by ``type``.
19841984
19851985
.. versionchanged:: 0.6
19861986

src/github3/repos/repo.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,18 @@ def _create_pull(self, data):
118118
return self._instance_or_null(pulls.ShortPullRequest, json)
119119

120120
@decorators.requires_auth
121-
def add_collaborator(self, username):
121+
def add_collaborator(self, username, permission=None):
122122
"""Add ``username`` as a collaborator to a repository.
123123
124124
:param username:
125125
(required), username of the user
126126
:type username:
127127
str or :class:`~github3.users.User`
128+
:param str permission:
129+
(optional), permission to grant the collaborator, valid on
130+
organization repositories only.
131+
Can be 'pull', 'triage', 'push', 'maintain', 'admin' or an
132+
organization-defined custom role name.
128133
:returns:
129134
True if successful, False otherwise
130135
:rtype:
@@ -134,7 +139,12 @@ def add_collaborator(self, username):
134139
url = self._build_url(
135140
"collaborators", str(username), base_url=self._api
136141
)
137-
return self._boolean(self._put(url), 201, 404)
142+
if permission:
143+
data = {"permission": permission}
144+
resp = self._put(url, data=jsonlib.dumps(data))
145+
else:
146+
resp = self._put(url)
147+
return self._boolean(resp, 201, 404)
138148

139149
def archive(self, format, path="", ref="master"):
140150
"""Get the tarball or zipball archive for this repo at ref.

0 commit comments

Comments
 (0)