Skip to content

Commit b26c724

Browse files
authored
Updates - black formatting, GH actions versions, tox 4 (mpdavis#313)
* Update GH actions, upgrade to tox 4 * reformat with the new version of black * Remove python 3.6 * More GHA updates * remove quotes
1 parent 96474ec commit b26c724

File tree

16 files changed

+33
-87
lines changed

16 files changed

+33
-87
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,66 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]
15+
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy3.9"]
1616
os: [ubuntu-latest, macos-latest, windows-latest]
1717
exclude:
1818
- os: macos-latest
19-
python-version: "pypy3"
19+
python-version: "pypy3.9"
2020
- os: windows-latest
21-
python-version: "pypy3"
21+
python-version: "pypy3.9"
2222
runs-on: ${{ matrix.os }}
2323
name: "${{ matrix.os }} Python: ${{ matrix.python-version }}"
2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626
with:
2727
fetch-depth: 0
2828
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v2
29+
uses: actions/setup-python@v4
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232
- name: Install dependencies
3333
run: |
34-
pip install -U "pip>=21.1"
35-
pip install -U setuptools
36-
pip install -U "tox>=3.23.0,<4" codecov tox-gh-actions coverage
34+
pip install -U "pip>=23.1.2"
35+
pip install -U "tox-gh-actions==3.1.0" coverage
3736
- name: Log python & pip versions
3837
run: |
3938
python --version
4039
pip --version
4140
- name: Run unit tests
4241
run: tox
43-
- name: "Coverage report"
42+
- name: Coverage report
4443
run: coverage xml
45-
- name: "Upload coverage to Codecov"
46-
uses: "codecov/codecov-action@v1"
44+
- name: Upload coverage to Codecov
45+
uses: codecov/codecov-action@v3
4746
with:
4847
fail_ci_if_error: true
4948
linting:
5049
runs-on: ubuntu-latest
5150
steps:
52-
- uses: actions/checkout@v2
53-
- uses: actions/setup-python@v2
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-python@v4
5453
with:
55-
python-version: 3.8
54+
python-version: 3.9
5655
- name: Install dependencies
5756
run: |
5857
pip install -U setuptools
59-
pip install -U "tox>=3.23.0,<4"
58+
pip install -U "tox>=4.5.1,<5"
6059
- run: tox -e lint
6160
package:
62-
name: "Build & verify package"
61+
name: Build & verify package
6362
runs-on: "ubuntu-latest"
6463
steps:
65-
- uses: "actions/checkout@v2"
66-
- uses: "actions/setup-python@v2"
64+
- uses: actions/checkout@v3
65+
- uses: actions/setup-python@v4
6766
with:
68-
python-version: "3.8"
69-
- name: "Install build, check-wheel-content, and twine"
67+
python-version: "3.9"
68+
- name: Install build, check-wheel-content, and twine
7069
run: "python -m pip install build twine check-wheel-contents"
71-
- name: "Build package"
70+
- name: Build package
7271
run: "python -m build --sdist --wheel ."
73-
- name: "List result"
72+
- name: List result
7473
run: "ls -l dist"
75-
- name: "Check wheel contents"
74+
- name: Check wheel contents
7675
run: "check-wheel-contents dist/*.whl"
77-
- name: "Check long_description"
76+
- name: Check long_description
7877
run: "python -m twine check dist/*"

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog #
22

3+
## 3.4.0 -- UNPUBLISHED ##
4+
5+
### News ###
6+
7+
* Remove support for python 3.6
8+
39
## 3.3.0 -- 2021-06-04 ##
410

511
### News ###
@@ -17,7 +23,6 @@
1723
* Updated Syntax to use Python 3.6+
1824
* Upgrade to latest pytest, remove used dev requirements.
1925

20-
2126
## 3.2.0 -- 2020-07-29 ##
2227

2328
### News ###
@@ -39,8 +44,6 @@
3944

4045
* Fixed some typos #160, #162, and #164
4146

42-
43-
4447
## 3.1.0 -- 2019-12-10 ##
4548

4649
This is a greatly overdue release.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# All configuration values have a default; values that are commented out
1111
# serve to show the default.
1212

13-
import sys
1413
import os
14+
import sys
1515

1616
# If extensions (or modules to document with autodoc) are in another directory,
1717
# add these directories to sys.path here. If the directory is relative to the

jose/backends/rsa_backend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ def public_key(self):
221221
return self.__class__(pyrsa.PublicKey(n=self._prepared_key.n, e=self._prepared_key.e), self._algorithm)
222222

223223
def to_pem(self, pem_format="PKCS8"):
224-
225224
if isinstance(self._prepared_key, pyrsa.PrivateKey):
226225
der = self._prepared_key.save_pkcs1(format="DER")
227226
if pem_format == "PKCS8":

jose/jws.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ def _sig_matches_keys(keys, signing_input, signature, alg):
215215

216216

217217
def _get_keys(key):
218-
219218
if isinstance(key, Key):
220219
return (key,)
221220

@@ -248,7 +247,6 @@ def _get_keys(key):
248247

249248

250249
def _verify_signature(signing_input, header, signature, key="", algorithms=None):
251-
252250
alg = header.get("alg")
253251
if not alg:
254252
raise JWSError("No algorithm was specified in the JWS header.")

jose/jwt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def encode(claims, key, algorithm=ALGORITHMS.HS256, headers=None, access_token=N
4242
"""
4343

4444
for time_claim in ["exp", "iat", "nbf"]:
45-
4645
# Convert datetime to a intDate value in known time-format claims
4746
if isinstance(claims.get(time_claim), datetime):
4847
claims[time_claim] = timegm(claims[time_claim].utctimetuple())
@@ -456,7 +455,6 @@ def _validate_at_hash(claims, access_token, algorithm):
456455

457456

458457
def _validate_claims(claims, audience=None, issuer=None, subject=None, algorithm=None, access_token=None, options=None):
459-
460458
leeway = options.get("leeway", 0)
461459

462460
if isinstance(leeway, timedelta):

jose/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
def long_to_bytes(n, blocksize=0):
1010
return _long_to_bytes(n, blocksize or None)
1111

12-
1312
except ImportError:
1413
from ecdsa.ecdsa import int_to_string as _long_to_bytes
1514

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ classifiers =
2121
Programming Language :: Python
2222
Programming Language :: Python :: 3
2323
Programming Language :: Python :: 3 :: Only
24-
Programming Language :: Python :: 3.6
2524
Programming Language :: Python :: 3.7
2625
Programming Language :: Python :: 3.8
2726
Programming Language :: Python :: 3.9

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
22
from setuptools import setup
33

4-
54
setup()

tests/algorithms/test_RSA.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ def test_python_rsa_legacy_private_key_pkcs8_to_pkcs1_invalid(self):
223223
None in (default_backend, pyca_rsa, CryptographyRSAKey), reason="Cryptography backend not available"
224224
)
225225
def test_cryptography_RSA_key_instance():
226-
227226
key = pyca_rsa.RSAPublicNumbers(
228227
int(65537),
229228
int(

0 commit comments

Comments
 (0)