Skip to content

Commit d5eff64

Browse files
authored
Fix tox "docs" environment to pass (jpadilla#567)
- Fixed doctest which included incorrect output. - Use intersphinx to allow linking to Python JSONEncoder class. - Fix param types after previous str/bytes cleanups. - Fix param syntax to avoid vertical bar. The command `tox -e docs` now passes.
1 parent 92aeab4 commit d5eff64

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Usage
4242
>>> import jwt
4343
>>> encoded = jwt.encode({"some": "payload"}, "secret", algorithm="HS256")
4444
>>> print(encoded)
45-
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
45+
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzb21lIjoicGF5bG9hZCJ9.Joh1R2dYzkRvDkqv3sygm5YyK8Gi4ShZqbhK2gxcs2U
4646
>>> jwt.decode(encoded, "secret", algorithms=["HS256"])
4747
{'some': 'payload'}
4848

docs/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ API Reference
2323

2424
Verify the ``jwt`` token signature and return the token claims.
2525

26-
:param str|bytes jwt: the token to be decoded
26+
:param str jwt: the token to be decoded
2727
:param str key: the key suitable for the allowed algorithm
2828

2929
:param list algorithms: allowed algorithms, e.g. ``["ES256"]``
@@ -43,9 +43,9 @@ API Reference
4343
* ``verify_iss=False`` check that ``iss`` (issuer) claim matches ``issuer``
4444
* ``verify_signature=True`` verify the JWT cryptographic signature
4545

46-
:param iterable audience: optional, the value for ``verify_aud`` check
46+
:param Iterable audience: optional, the value for ``verify_aud`` check
4747
:param str issuer: optional, the value for ``verify_iss`` check
48-
:param int|float leeway: a time margin in seconds for the expiration check
48+
:param float leeway: a time margin in seconds for the expiration check
4949
:rtype: dict
5050
:returns: the JWT claims
5151

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def find_version(*file_paths):
8383
# If true, `todo` and `todoList` produce output, else they produce nothing.
8484
todo_include_todos = False
8585

86+
# Intersphinx extension.
87+
intersphinx_mapping = {
88+
"python": ("https://docs.python.org/3/", None),
89+
}
8690

8791
# -- Options for HTML output ----------------------------------------------
8892

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Example Usage
3232
>>> import jwt
3333
>>> encoded_jwt = jwt.encode({"some": "payload"}, "secret", algorithm="HS256")
3434
>>> print(encoded_jwt)
35-
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
35+
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzb21lIjoicGF5bG9hZCJ9.Joh1R2dYzkRvDkqv3sygm5YyK8Gi4ShZqbhK2gxcs2U
3636
>>> jwt.decode(encoded_jwt, "secret", algorithms=["HS256"])
3737
{'some': 'payload'}
3838

0 commit comments

Comments
 (0)