Skip to content

Commit e67fa14

Browse files
author
staticdev
committed
Support Python 3.8 and 3.9
1 parent f3bf7cb commit e67fa14

40 files changed

+233
-215
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@ jobs:
99
strategy:
1010
matrix:
1111
python:
12-
- { VERSION: "2.7", TOXENV: "py27", ALLOW_FAILURE: false }
13-
- { VERSION: "2.7", TOXENV: "py27-flake8", ALLOW_FAILURE: false}
14-
- { VERSION: "3.5", TOXENV: "py35", ALLOW_FAILURE: false }
1512
- { VERSION: "3.6", TOXENV: "py36", ALLOW_FAILURE: false }
1613
- { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false }
17-
- { VERSION: "3.8", TOXENV: "py38-flake8,readme,doclint,docs,commitlint",ALLOW_FAILURE: false }
18-
- { VERSION: "3.8", TOXENV: "docstrings", ALLOW_FAILURE: true}
19-
- { VERSION: "pypy2", TOXENV: "pypy", ALLOW_FAILURE: false }
14+
- { VERSION: "3.8", TOXENV: "py38",ALLOW_FAILURE: false }
15+
- { VERSION: "3.9", TOXENV: "py39-flake8,readme,doclint,docs,commitlint",ALLOW_FAILURE: false }
16+
- { VERSION: "3.9", TOXENV: "docstrings", ALLOW_FAILURE: true}
2017
- { VERSION: "pypy3", TOXENV: "pypy", ALLOW_FAILURE: false }
2118

2219
steps:
23-
- uses: actions/checkout@v2
20+
- name: Check out the repository
21+
uses: actions/checkout@v2.3.4
2422
- name: Setup Python
25-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v2.2.1
2624
with:
2725
python-version: ${{ matrix.PYTHON.VERSION }}
28-
- name: Install Tox and any other packages
29-
run: pip install tox
26+
- name: Upgrade pip
27+
run: |
28+
pip install --constraint=.github/workflows/constraints.txt pip
29+
pip --version
30+
- name: Install Tox
31+
run: |
32+
pip install --constraint=.github/workflows/constraints.txt tox
33+
tox --version
3034
- name: Run Tox
3135
run: tox
3236
env:

.github/workflows/constraints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pip==20.3.3
2+
tox==3.20.1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ tests/id_rsa
2424
.pytest_cache/
2525
t.py
2626
*.pem
27+
/.python-version

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
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.
8+
79
Installation
810
------------
911

@@ -36,11 +38,9 @@ this in a virtual environment. These need to be installed for the tests to run.
3638

3739
- betamax_
3840
- coverage_ by Ned Batchelder
39-
- mock_ by Michael Foord
4041

4142
.. _betamax: https://github.com/sigmavirus24/betamax
4243
.. _coverage: http://nedbatchelder.com/code/coverage/
43-
.. _mock: https://mock.readthedocs.io/en/latest/
4444

4545
Build status
4646
~~~~~~~~~~~~

appveyor.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ environment:
55
matrix:
66
# http://www.appveyor.com/docs/installed-software#python lists available
77
# versions
8-
- PYTHON: "C:\\Python27"
9-
TOXENV: py27
10-
- PYTHON: "C:\\Python27-x64"
11-
TOXENV: py27
12-
- PYTHON: "C:\\Python35"
13-
TOXENV: py35
14-
- PYTHON: "C:\\Python35-x64"
15-
TOXENV: py35
168
- PYTHON: "C:\\Python36"
179
TOXENV: py36
1810
- PYTHON: "C:\\Python36-x64"
@@ -21,6 +13,10 @@ environment:
2113
TOXENV: py37
2214
- PYTHON: "C:\\Python37-x64"
2315
TOXENV: py37
16+
- PYTHON: "C:\\Python38-x64"
17+
TOXENV: py38
18+
- PYTHON: "C:\\Python39-x64"
19+
TOXENV: py39
2420

2521
init:
2622
- "echo %PYTHON%"

dev-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.
22
#coverage==3.5.2
3-
mock==1.0.1
43
pytest>=2.3.5,<3.3.0
54
wheel==0.21.0
65
betamax>=0.5.0

docs/source/index.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,37 +122,37 @@ The tests are generally run using tox. Tox can be installed like so
122122
123123
pip install tox
124124
125-
We test against PyPy and the following versions of Python:
125+
We test against PyPy3 and the following versions of Python:
126126

127-
- 2.7
127+
- 3.6
128128

129-
- 3.4
129+
- 3.7
130130

131-
- 3.5
131+
- 3.8
132132

133-
- 3.6
133+
- 3.9
134134

135135
If you simply run ``tox`` it will run tests against all of these versions of
136136
python and run ``flake8`` against the codebase as well. If you want to run
137137
against one specific version, you can do
138138

139139
.. code-block:: console
140140
141-
tox -e py36
141+
tox -e py39
142142
143143
And if you want to run tests against a specific file, you can do
144144

145145
.. code-block:: console
146146
147-
tox -e py36 -- tests/unit/test_github.py
147+
tox -e py39 -- tests/unit/test_github.py
148148
149149
To run the tests, ``tox`` uses ``py.test`` so you can pass any options or
150150
parameters to ``py.test`` after specifying ``--``. For example, you can get
151151
more verbose output by doing
152152

153153
.. code-block:: console
154154
155-
tox -e py36 -- -vv
155+
tox -e py39 -- -vv
156156
157157
.. toctree::
158158

docs/source/release-notes/1.4.0.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1.4.0: 2020-12-29
2+
-----------------
3+
4+
Features Added
5+
``````````````
6+
7+
- Add support to Python 3.8 and 3.9.
8+
- Remove support to Python versions that reached end-of-life (2, 3.4 and 3.5).
9+
- Update CI/CD to thoroughly test all supported version.
10+
- Remove compatibility imports for Python 2.
11+
- Remove dev-dependency for mock.

docs/source/release-notes/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ here with the newest releases first.
99
==================
1010

1111
.. toctree::
12+
1.4.0
1213
1.3.0
1314
1.2.0
1415
1.1.0

example-notebooks/two_factor_authentication.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
"cell_type": "markdown",
4242
"metadata": {},
4343
"source": [
44-
"This handler will work on Python 2 and Python 3. (In Python 2, to prompt the user, you want to use `raw_input` but that was replaced in Python 3 with `input`.)\n",
45-
"\n",
4644
"This will ask the user to type in their token and then return it to github3.py. If you're developing a GUI, you will want to write a different handler, but that is out of the scope of this example.\n",
4745
"\n",
4846
"To use the handler above you can pass it to the `github3.login` function."

0 commit comments

Comments
 (0)