Skip to content

Commit a64a82d

Browse files
committed
Satisfy check-manifest
1 parent f2dd84a commit a64a82d

File tree

11 files changed

+64
-42
lines changed

11 files changed

+64
-42
lines changed

.coveragerc

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

.flake8

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

MANIFEST.in

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,23 @@ include README.rst
22
include CHANGELOG.md
33
include LICENSE
44
include AUTHORS
5+
include *.rst *.toml *.yml *.yaml *.md
6+
graft .github
7+
global-exclude *.pyc
8+
9+
# Tests
510
include tox.ini
6-
recursive-exclude * __pycache__
7-
recursive-exclude * *.py[co]
8-
graft tests
11+
recursive-include tests *.py
12+
recursive-include tests *.cer
13+
recursive-include tests *.json
14+
recursive-include tests *.pem
15+
recursive-include tests *.pub
16+
recursive-include tests *.priv
17+
18+
# Documentation
19+
include docs/Makefile docs/docutils.conf
20+
recursive-include docs *.py
21+
recursive-include docs *.rst
22+
recursive-include docs *.css
23+
recursive-include docs *.txt
24+
prune docs/_build

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55

6+
[tool.coverage.run]
7+
parallel = true
8+
branch = true
9+
source = ["jwt"]
10+
11+
[tool.coverage.paths]
12+
source = ["src", ".tox/*/site-packages"]
13+
14+
[tool.coverage.report]
15+
show_missing = true
16+
17+
618
[tool.black]
719
line-length = 79
820

pytest.ini

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

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
EXTRAS_REQUIRE = {
3434
"jwks-client": ["requests"],
3535
"tests": [
36-
"pytest>=4.0.1,<5.0.0",
37-
"pytest-cov>=2.6.0,<3.0.0",
36+
"coverage[toml]>=5.0.2",
37+
"pytest>=4.3.0,<5.0.0",
3838
"requests-mock>=1.7.0,<2.0.0",
3939
],
4040
"cryptography": ["cryptography >= 1.4"],

tests/test_algorithms.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_rsa_should_parse_pem_public_key(self):
143143
def test_rsa_should_accept_pem_private_key_bytes(self):
144144
algo = RSAAlgorithm(RSAAlgorithm.SHA256)
145145

146-
with open(key_path("testkey_rsa"), "rb") as pem_key:
146+
with open(key_path("testkey_rsa.priv"), "rb") as pem_key:
147147
algo.prepare_key(pem_key.read())
148148

149149
@pytest.mark.skipif(
@@ -152,7 +152,7 @@ def test_rsa_should_accept_pem_private_key_bytes(self):
152152
def test_rsa_should_accept_unicode_key(self):
153153
algo = RSAAlgorithm(RSAAlgorithm.SHA256)
154154

155-
with open(key_path("testkey_rsa"), "r") as rsa_key:
155+
with open(key_path("testkey_rsa.priv"), "r") as rsa_key:
156156
algo.prepare_key(force_unicode(rsa_key.read()))
157157

158158
@pytest.mark.skipif(
@@ -300,7 +300,7 @@ def test_rsa_jwk_public_and_private_keys_should_parse_and_verify(self):
300300
def test_rsa_private_key_to_jwk_works_with_from_jwk(self):
301301
algo = RSAAlgorithm(RSAAlgorithm.SHA256)
302302

303-
with open(key_path("testkey_rsa"), "r") as rsa_key:
303+
with open(key_path("testkey_rsa.priv"), "r") as rsa_key:
304304
orig_key = algo.prepare_key(force_unicode(rsa_key.read()))
305305

306306
parsed_key = algo.from_jwk(algo.to_jwk(orig_key))
@@ -431,7 +431,7 @@ def test_rsa_to_jwk_returns_correct_values_for_public_key(self):
431431
def test_rsa_to_jwk_returns_correct_values_for_private_key(self):
432432
algo = RSAAlgorithm(RSAAlgorithm.SHA256)
433433

434-
with open(key_path("testkey_rsa"), "r") as keyfile:
434+
with open(key_path("testkey_rsa.priv"), "r") as keyfile:
435435
priv_key = algo.prepare_key(keyfile.read())
436436

437437
key = algo.to_jwk(priv_key)
@@ -518,7 +518,7 @@ def test_ec_should_reject_non_string_key(self):
518518
def test_ec_should_accept_unicode_key(self):
519519
algo = ECAlgorithm(ECAlgorithm.SHA256)
520520

521-
with open(key_path("testkey_ec"), "r") as ec_key:
521+
with open(key_path("testkey_ec.priv"), "r") as ec_key:
522522
algo.prepare_key(force_unicode(ec_key.read()))
523523

524524
@pytest.mark.skipif(
@@ -527,7 +527,7 @@ def test_ec_should_accept_unicode_key(self):
527527
def test_ec_should_accept_pem_private_key_bytes(self):
528528
algo = ECAlgorithm(ECAlgorithm.SHA256)
529529

530-
with open(key_path("testkey_ec"), "rb") as ec_key:
530+
with open(key_path("testkey_ec.priv"), "rb") as ec_key:
531531
algo.prepare_key(ec_key.read())
532532

533533
@pytest.mark.skipif(
@@ -588,7 +588,7 @@ def test_rsa_pss_sign_then_verify_should_return_true(self):
588588

589589
message = force_bytes("Hello World!")
590590

591-
with open(key_path("testkey_rsa"), "r") as keyfile:
591+
with open(key_path("testkey_rsa.priv"), "r") as keyfile:
592592
priv_key = algo.prepare_key(keyfile.read())
593593
sig = algo.sign(message, priv_key)
594594

tests/test_api_jws.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def test_get_unverified_header_fails_on_bad_header_types(
494494
)
495495
def test_encode_decode_with_rsa_sha256(self, jws, payload):
496496
# PEM-formatted RSA key
497-
with open("tests/keys/testkey_rsa", "r") as rsa_priv_file:
497+
with open("tests/keys/testkey_rsa.priv", "r") as rsa_priv_file:
498498
priv_rsakey = load_pem_private_key(
499499
force_bytes(rsa_priv_file.read()),
500500
password=None,
@@ -510,7 +510,7 @@ def test_encode_decode_with_rsa_sha256(self, jws, payload):
510510
jws.decode(jws_message, pub_rsakey, algorithms=["RS256"])
511511

512512
# string-formatted key
513-
with open("tests/keys/testkey_rsa", "r") as rsa_priv_file:
513+
with open("tests/keys/testkey_rsa.priv", "r") as rsa_priv_file:
514514
priv_rsakey = rsa_priv_file.read()
515515
jws_message = jws.encode(payload, priv_rsakey, algorithm="RS256")
516516

@@ -523,7 +523,7 @@ def test_encode_decode_with_rsa_sha256(self, jws, payload):
523523
)
524524
def test_encode_decode_with_rsa_sha384(self, jws, payload):
525525
# PEM-formatted RSA key
526-
with open("tests/keys/testkey_rsa", "r") as rsa_priv_file:
526+
with open("tests/keys/testkey_rsa.priv", "r") as rsa_priv_file:
527527
priv_rsakey = load_pem_private_key(
528528
force_bytes(rsa_priv_file.read()),
529529
password=None,
@@ -538,7 +538,7 @@ def test_encode_decode_with_rsa_sha384(self, jws, payload):
538538
jws.decode(jws_message, pub_rsakey, algorithms=["RS384"])
539539

540540
# string-formatted key
541-
with open("tests/keys/testkey_rsa", "r") as rsa_priv_file:
541+
with open("tests/keys/testkey_rsa.priv", "r") as rsa_priv_file:
542542
priv_rsakey = rsa_priv_file.read()
543543
jws_message = jws.encode(payload, priv_rsakey, algorithm="RS384")
544544

@@ -551,7 +551,7 @@ def test_encode_decode_with_rsa_sha384(self, jws, payload):
551551
)
552552
def test_encode_decode_with_rsa_sha512(self, jws, payload):
553553
# PEM-formatted RSA key
554-
with open("tests/keys/testkey_rsa", "r") as rsa_priv_file:
554+
with open("tests/keys/testkey_rsa.priv", "r") as rsa_priv_file:
555555
priv_rsakey = load_pem_private_key(
556556
force_bytes(rsa_priv_file.read()),
557557
password=None,
@@ -566,7 +566,7 @@ def test_encode_decode_with_rsa_sha512(self, jws, payload):
566566
jws.decode(jws_message, pub_rsakey, algorithms=["RS512"])
567567

568568
# string-formatted key
569-
with open("tests/keys/testkey_rsa", "r") as rsa_priv_file:
569+
with open("tests/keys/testkey_rsa.priv", "r") as rsa_priv_file:
570570
priv_rsakey = rsa_priv_file.read()
571571
jws_message = jws.encode(payload, priv_rsakey, algorithm="RS512")
572572

@@ -599,7 +599,7 @@ def test_rsa_related_algorithms(self, jws):
599599
)
600600
def test_encode_decode_with_ecdsa_sha256(self, jws, payload):
601601
# PEM-formatted EC key
602-
with open("tests/keys/testkey_ec", "r") as ec_priv_file:
602+
with open("tests/keys/testkey_ec.priv", "r") as ec_priv_file:
603603
priv_eckey = load_pem_private_key(
604604
force_bytes(ec_priv_file.read()),
605605
password=None,
@@ -614,7 +614,7 @@ def test_encode_decode_with_ecdsa_sha256(self, jws, payload):
614614
jws.decode(jws_message, pub_eckey, algorithms=["ES256"])
615615

616616
# string-formatted key
617-
with open("tests/keys/testkey_ec", "r") as ec_priv_file:
617+
with open("tests/keys/testkey_ec.priv", "r") as ec_priv_file:
618618
priv_eckey = ec_priv_file.read()
619619
jws_message = jws.encode(payload, priv_eckey, algorithm="ES256")
620620

@@ -628,7 +628,7 @@ def test_encode_decode_with_ecdsa_sha256(self, jws, payload):
628628
def test_encode_decode_with_ecdsa_sha384(self, jws, payload):
629629

630630
# PEM-formatted EC key
631-
with open("tests/keys/testkey_ec", "r") as ec_priv_file:
631+
with open("tests/keys/testkey_ec.priv", "r") as ec_priv_file:
632632
priv_eckey = load_pem_private_key(
633633
force_bytes(ec_priv_file.read()),
634634
password=None,
@@ -643,7 +643,7 @@ def test_encode_decode_with_ecdsa_sha384(self, jws, payload):
643643
jws.decode(jws_message, pub_eckey, algorithms=["ES384"])
644644

645645
# string-formatted key
646-
with open("tests/keys/testkey_ec", "r") as ec_priv_file:
646+
with open("tests/keys/testkey_ec.priv", "r") as ec_priv_file:
647647
priv_eckey = ec_priv_file.read()
648648
jws_message = jws.encode(payload, priv_eckey, algorithm="ES384")
649649

@@ -656,7 +656,7 @@ def test_encode_decode_with_ecdsa_sha384(self, jws, payload):
656656
)
657657
def test_encode_decode_with_ecdsa_sha512(self, jws, payload):
658658
# PEM-formatted EC key
659-
with open("tests/keys/testkey_ec", "r") as ec_priv_file:
659+
with open("tests/keys/testkey_ec.priv", "r") as ec_priv_file:
660660
priv_eckey = load_pem_private_key(
661661
force_bytes(ec_priv_file.read()),
662662
password=None,
@@ -671,7 +671,7 @@ def test_encode_decode_with_ecdsa_sha512(self, jws, payload):
671671
jws.decode(jws_message, pub_eckey, algorithms=["ES512"])
672672

673673
# string-formatted key
674-
with open("tests/keys/testkey_ec", "r") as ec_priv_file:
674+
with open("tests/keys/testkey_ec.priv", "r") as ec_priv_file:
675675
priv_eckey = ec_priv_file.read()
676676
jws_message = jws.encode(payload, priv_eckey, algorithm="ES512")
677677

0 commit comments

Comments
 (0)