Skip to content

Commit b4e790b

Browse files
authored
Merge pull request #523 from requests/removepyversions
Removed older python versions (2.7,<=3.7)
2 parents 0146ecb + 2835b46 commit b4e790b

File tree

14 files changed

+56
-74
lines changed

14 files changed

+56
-74
lines changed

.github/workflows/run-tests.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,22 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
include:
14-
- python-version: "2.7"
15-
tox-env: py27
16-
- python-version: "3.6"
17-
tox-env: py36
18-
- python-version: "3.7"
19-
tox-env: py37,docs,readme,black
2014
- python-version: "3.8"
2115
tox-env: py38
2216
- python-version: "3.9"
2317
tox-env: py39
2418
- python-version: "3.10"
25-
tox-env: py310
19+
tox-env: py310,docs,readme,ruff
2620
- python-version: "3.11"
2721
tox-env: py311
2822
- python-version: "3.12"
2923
tox-env: py312
30-
- python-version: "pypy3"
31-
tox-env: pypy3
24+
- python-version: "pypy3.10"
25+
tox-env: pypy310
3226
steps:
33-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
3428
- name: Set up Python ${{ matrix.python-version }}
35-
uses: actions/setup-python@v4
29+
uses: actions/setup-python@v5
3630
with:
3731
python-version: ${{ matrix.python-version }}
3832
allow-prereleases: true
@@ -41,7 +35,6 @@ jobs:
4135
python -m pip install --upgrade pip setuptools
4236
python -m pip install tox
4337
- name: Install coveralls dependencies
44-
if: ${{ matrix.python-version != '2.7' }}
4538
run: |
4639
python -m pip install coveralls coverage-lcov toml
4740
- name: Execute tests with tox
@@ -50,12 +43,10 @@ jobs:
5043
run: |
5144
tox
5245
- name: Coverage format into lcov
53-
if: ${{ matrix.python-version != '2.7' }}
5446
run: |
5547
coverage-lcov --output_file_path lcov.info
5648
- name: Coveralls Parallel
5749
uses: coverallsapp/github-action@1.1.3
58-
if: ${{ matrix.python-version != '2.7' }}
5950
with:
6051
github-token: ${{ secrets.github_token }}
6152
flag-name: run-${{ matrix.python-version }}
@@ -66,7 +57,7 @@ jobs:
6657
runs-on: ubuntu-latest
6758
steps:
6859
- name: Coveralls Finished
69-
uses: coverallsapp/github-action@master
60+
uses: coverallsapp/github-action@1.1.3
7061
with:
7162
github-token: ${{ secrets.github_token }}
7263
path-to-lcov: lcov.info

AUTHORS.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Requests-oauthlib is written and maintained by Kenneth Reitz and various
2-
contributors:
1+
Requests-oauthlib has been written by Kenneth Reitz, various contributors:
32

4-
Development Lead
3+
Initial Write-up
54
----------------
65

76
- Kenneth Reitz <me@kennethreitz.com>
87

9-
Patches and Suggestions
10-
-----------------------
8+
Maintainers & Contributors
9+
--------------------------
1110

1211
- Cory Benfield <cory@lukasa.co.uk>
1312
- Ib Lundgren <ib.lundgren@gmail.com>
1413
- Devin Sevilla <dasevilla@gmail.com>
1514
- Imad Mouhtassem <mouhtasi@gmail.com>
1615
- Johan Euphrosine <proppy@google.com>
1716
- Johannes Spielmann <js@shezi.de>
17+
- Jonathan Huot <jonathan.huot@gmail.com>
1818
- Martin Trigaux <me@mart-e.be>
1919
- Matt McClure <matt.mcclure@mapmyfitness.com>
2020
- Mikhail Sobolev <mss@mawhrin.net>

HISTORY.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ v1.4.0 (TBD)
99
- ``OAuth2Session`` constructor now uses its ``client.scope`` when a ``client``
1010
is provided and ``scope`` is not overridden. Fixes `#408
1111
<https://github.com/requests/requests-oauthlib/issues/408>`_
12-
- Add support for Python 3.8-3.10
12+
- Add support for Python 3.8-3.12
13+
- Remove support of Python 2.x, <3.7
14+
- Migrated to Github Action
1315

1416

1517
v1.3.1 (21 January 2022)

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import os
15+
import sys
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
1819
# documentation root, use os.path.abspath to make it absolute, like shown here.
1920
sys.path.insert(0, os.path.abspath(".."))
20-
from requests_oauthlib import __version__
21+
from requests_oauthlib import __version__ # noqa: E402
2122

2223
# -- General configuration -----------------------------------------------------
2324

docs/contributing.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Test simple changes
77

88
Requests-OAuthlib is using `tox`_ as main test tool.
99
It helps creating the required virtualenv for your python version.
10-
For example, if you have installed Python3.7:
10+
For example, if you have installed Python3.8:
1111

1212
.. sourcecode:: bash
1313

14-
$ tox -e py37
14+
$ tox -e py38
1515

1616

1717
Validate documentation changes
@@ -40,22 +40,31 @@ In order to run successfully, you will need all versions of Python installed. We
4040

4141
.. sourcecode:: bash
4242

43-
$ pyenv install 2.7.18
44-
$ pyenv install 3.4.10
45-
$ pyenv install 3.5.10
46-
$ pyenv install 3.6.14
47-
$ pyenv install 3.7.11
48-
$ pyenv install pypy2.7-7.1.1
49-
$ pyenv install pypy3.6-7.1.1
43+
$ pyenv install 3.8.18
44+
$ pyenv install pypy3.10-7.3.13
45+
$ pyenv global pypy3.10-7.3.13 # switch to pypy
5046

5147

48+
Build and test via pipeline
49+
===========================
50+
51+
If you don't want to install multiple python versions, or if you have
52+
made changes in the pipeline code, it is possible to execute the Github Action
53+
locally with the `act` tools available here: https://nektosact.com/usage/index.html
54+
55+
Run tests for `pypy3.9`:
56+
57+
```shell
58+
act -W .github/workflows/run-tests.yml -j tests --matrix python-version:pypy3.9
59+
```
60+
5261
Publishing a release (for maintainer role)
5362
==========================================
5463

5564
Maintainer tasks should always be kept to minimum. Once a release is ready, the suggested approach can be followed:
5665

5766
#. Create new branch release-X.Y.Z
58-
#. Update the HISTORY.rst file
67+
#. Update HISTORY.rst and AUTHORS.rst if required
5968
#. Update the `request_oauthlib/__init__.py`
6069
#. Raise a pull request to give a chance for all contributors to comment before publishing
6170
#. Create a TAG vX.Y.Z. By doing this, the pipeline will automatically trigger `twine` and will publish the release to PyPi.

docs/requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
sphinx<2
2-
docutils<=0.15 # docutils 0.16 has an error when generating in api.rst
3-
sphinx_rtd_theme<0.5
1+
sphinx
2+
sphinx_rtd_theme
43
readthedocs-sphinx-ext

requests_oauthlib/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
# ruff: noqa: F401
12
import logging
23

34
from .oauth1_auth import OAuth1
45
from .oauth1_session import OAuth1Session
56
from .oauth2_auth import OAuth2
67
from .oauth2_session import OAuth2Session, TokenUpdated
78

8-
__version__ = "1.3.1"
9+
__version__ = "1.4.0-dev"
910

1011
import requests
1112

requests_oauthlib/compliance_fixes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: F401
12
from __future__ import absolute_import
23

34
from .facebook import facebook_compliance_fix

requests_oauthlib/oauth2_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def refresh_token(
476476
r = hook(r)
477477

478478
self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
479-
if not "refresh_token" in self.token:
479+
if "refresh_token" not in self.token:
480480
log.debug("No new refresh token given. Re-using old.")
481481
self.token["refresh_token"] = refresh_token
482482
return self.token

requirements-test-27.txt

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

0 commit comments

Comments
 (0)