Skip to content

Commit 2b735fe

Browse files
authored
Merge pull request #178 from jschlyter/upgrade_ruff
Update ruff
2 parents e1100fe + 41fd206 commit 2b735fe

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

.github/workflows/test.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ jobs:
1717
cancel_others: 'true'
1818
concurrent_skipping: same_content
1919
ruff:
20-
runs-on: ubuntu-latest
2120
needs: pre_job
21+
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
24-
- uses: chartboost/ruff-action@v1
24+
- uses: astral-sh/ruff-action@v3
25+
with:
26+
version: latest
27+
- run: ruff check
28+
- run: ruff format --check
2529
test:
2630
needs: ruff
2731
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-merge-conflict
66
- id: debug-statements
@@ -9,7 +9,7 @@ repos:
99
- id: check-yaml
1010
- id: check-json
1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.8.0
12+
rev: v0.9.9
1313
hooks:
1414
- id: ruff
1515
- id: ruff-format

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ responses = "^0.13.0"
3030
sphinx = "^3.5.2"
3131
sphinx-autobuild = "^2021.3.14"
3232
coverage = "^7"
33-
ruff = ">=0.8.0"
33+
ruff = ">=0.9.9"
3434
pytest-ruff = "^0.3.2"
3535

3636
[build-system]

src/cryptojwt/jws/dsa.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def sign(self, msg, key):
4040
"""
4141

4242
if not isinstance(key, ec.EllipticCurvePrivateKey):
43-
raise TypeError("The private key must be an instance of " "ec.EllipticCurvePrivateKey")
43+
raise TypeError("The private key must be an instance of ec.EllipticCurvePrivateKey")
4444

4545
self._cross_check(key.public_key())
4646
num_bits = key.curve.key_size
@@ -62,7 +62,7 @@ def verify(self, msg, sig, key):
6262
:return: True
6363
"""
6464
if not isinstance(key, ec.EllipticCurvePublicKey):
65-
raise TypeError("The public key must be an instance of " "ec.EllipticCurvePublicKey")
65+
raise TypeError("The public key must be an instance of ec.EllipticCurvePublicKey")
6666
self._cross_check(key)
6767

6868
num_bits = key.curve.key_size

tests/test_02_jwk.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ def test_serialize_rsa_priv_key():
150150
ECKEY = {
151151
"crv": "P-521",
152152
"x": "AekpBQ8ST8a8VcfVOTNl353vSrDCLLJXmPk06wTjxrrjcBpXp5EOnYG_NjFZ6OvLFV1jSfS9tsz4qUxcWceqwQGk",
153-
"y": "ADSmRA43Z1DSNx_RvcLI87cdL07l6jQyyBXMoxVg_l2Th"
154-
"-x3S1WDhjDly79ajL4Kkd0AZMaZmh9ubmf63e3kyMj2",
153+
"y": "ADSmRA43Z1DSNx_RvcLI87cdL07l6jQyyBXMoxVg_l2Th-x3S1WDhjDly79ajL4Kkd0AZMaZmh9ubmf63e3kyMj2",
155154
"d": "AY5pb7A0UFiB3RELSD64fTLOSV_jazdF7fLYyuTw8lOfRhWg6Y6rUrPAxerEzgdRhajnu0ferB0d53vM9mE15j2C",
156155
}
157156

tests/test_03_key_bundle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def full_path(local_file):
7474
"kid": "rsa1",
7575
},
7676
{
77-
"k": "YTEyZjBlMDgxMGI4YWU4Y2JjZDFiYTFlZTBjYzljNDU3YWM0ZWNiNzhmNmFlYTNkNT" "Y0NzMzYjE",
77+
"k": "YTEyZjBlMDgxMGI4YWU4Y2JjZDFiYTFlZTBjYzljNDU3YWM0ZWNiNzhmNmFlYTNkNTY0NzMzYjE",
7878
"kty": "oct",
7979
},
8080
]

tests/test_06_jws.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def test_a_1_1a():
418418

419419

420420
def test_a_1_1b():
421-
payload = b'{"iss":"joe",\r\n "exp":1300819380,' b'\r\n "http://example.com/is_root":true}'
421+
payload = b'{"iss":"joe",\r\n "exp":1300819380,\r\n "http://example.com/is_root":true}'
422422
val = b64e(payload)
423423
assert val == (
424424
b"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9"
@@ -430,7 +430,7 @@ def test_a_1_1c():
430430
hmac = intarr2bin(HMAC_KEY)
431431
signer = SIGNER_ALGS["HS256"]
432432
header = b'{"typ":"JWT",\r\n "alg":"HS256"}'
433-
payload = b'{"iss":"joe",\r\n "exp":1300819380,' b'\r\n "http://example.com/is_root":true}'
433+
payload = b'{"iss":"joe",\r\n "exp":1300819380,\r\n "http://example.com/is_root":true}'
434434
sign_input = b64e(header) + b"." + b64e(payload)
435435
sig = signer.sign(sign_input, hmac)
436436
assert b64e(sig) == b"dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"

0 commit comments

Comments
 (0)