<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pyjwt.git/tests/test_api_jws.py, branch version-2.0.1</title>
<subtitle>github.com: progrium/pyjwt.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/'/>
<entry>
<title>Combine repetitive encode/decode tests using parametrize (#577)</title>
<updated>2020-12-22T02:34:32+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-22T02:34:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=09d24fc9fd916a8e3ebc3bf993340893d74991ee'/>
<id>09d24fc9fd916a8e3ebc3bf993340893d74991ee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify black configuration to be closer to upstream defaults (#568)</title>
<updated>2020-12-21T16:30:48+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-21T16:30:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=811ae79ceaae8ad9bbad24c30e2d3dd4d920e4df'/>
<id>811ae79ceaae8ad9bbad24c30e2d3dd4d920e4df</id>
<content type='text'>
* Simplify black configuration to be closer to upstream defaults

Avoid extra configuration by simply going with Black defaults. This
allows removing some configuration options, thus simplifying the overall
configuration.

It also makes the code style closer to community conventions. As more
projects adopt black formatting, more code will look like the black
defaults.

Further, the default 88 tends to create more readable lines, IMO. The
black rationale is located at:
https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length

* Update tests/test_api_jws.py

Co-authored-by: José Padilla &lt;jpadilla@webapplicate.com&gt;

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update tests/test_api_jws.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: José Padilla &lt;jpadilla@webapplicate.com&gt;
Co-authored-by: pre-commit-ci[bot] &lt;66853113+pre-commit-ci[bot]@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Simplify black configuration to be closer to upstream defaults

Avoid extra configuration by simply going with Black defaults. This
allows removing some configuration options, thus simplifying the overall
configuration.

It also makes the code style closer to community conventions. As more
projects adopt black formatting, more code will look like the black
defaults.

Further, the default 88 tends to create more readable lines, IMO. The
black rationale is located at:
https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length

* Update tests/test_api_jws.py

Co-authored-by: José Padilla &lt;jpadilla@webapplicate.com&gt;

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update tests/test_api_jws.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: José Padilla &lt;jpadilla@webapplicate.com&gt;
Co-authored-by: pre-commit-ci[bot] &lt;66853113+pre-commit-ci[bot]@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer ModuleNotFoundError over ImportError (#565)</title>
<updated>2020-12-21T16:05:53+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-21T16:05:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=541dd0dd8cafacc0aff9fa36cf04251c535f69eb'/>
<id>541dd0dd8cafacc0aff9fa36cf04251c535f69eb</id>
<content type='text'>
ModuleNotFoundError was introduced in Python 3. It is raised when the
module does not exist. On the other hand, ImportError is raised during
any import failure. For example, a syntax error or other runtime error.

Using ModuleNotFoundError means that errors unrelated to a missing
package will be propagated to the user. PyJWT doesn't know how to handle
these.

This also allows more functions to always be available for import</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ModuleNotFoundError was introduced in Python 3. It is raised when the
module does not exist. On the other hand, ImportError is raised during
any import failure. For example, a syntax error or other runtime error.

Using ModuleNotFoundError means that errors unrelated to a missing
package will be propagated to the user. PyJWT doesn't know how to handle
these.

This also allows more functions to always be available for import</pre>
</div>
</content>
</entry>
<entry>
<title>Add utility functions to assist test skipping (#563)</title>
<updated>2020-12-19T23:40:27+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-19T23:40:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=9acab9cad0ee536f41aca39f5d4cf09680bf1ffb'/>
<id>9acab9cad0ee536f41aca39f5d4cf09680bf1ffb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Split PyJWT/PyJWS classes to tighten type interfaces (#559)</title>
<updated>2020-12-19T23:32:12+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-19T23:32:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=94d102b2e38d09f3c5ec459a8365de8a86c51fe5'/>
<id>94d102b2e38d09f3c5ec459a8365de8a86c51fe5</id>
<content type='text'>
The class PyJWT was previously a subclass of PyJWS. However, this
combination does not follow the Liskov substitution principle. That is,
using PyJWT in place of a PyJWS would not produce correct results or
follow type contracts.

While these classes look to share a common interface it doesn't go
beyond the method names "encode" and "decode" and so is merely
superficial.

The classes have been split into two. PyJWT now uses composition instead
of inheritance to achieve the desired behavior. Splitting the classes in
this way allowed for precising the type interfaces.

The complete parameter to .decode() has been removed. This argument was
used to alter the return type of .decode(). Now, there are two different
methods with more explicit return types and values. The new method name
is .decode_complete(). This fills the previous role filled by
.decode(..., complete=True).

Closes #554, #396, #394

Co-authored-by: Sam Bull &lt;git@sambull.org&gt;

Co-authored-by: Sam Bull &lt;git@sambull.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The class PyJWT was previously a subclass of PyJWS. However, this
combination does not follow the Liskov substitution principle. That is,
using PyJWT in place of a PyJWS would not produce correct results or
follow type contracts.

While these classes look to share a common interface it doesn't go
beyond the method names "encode" and "decode" and so is merely
superficial.

The classes have been split into two. PyJWT now uses composition instead
of inheritance to achieve the desired behavior. Splitting the classes in
this way allowed for precising the type interfaces.

The complete parameter to .decode() has been removed. This argument was
used to alter the return type of .decode(). Now, there are two different
methods with more explicit return types and values. The new method name
is .decode_complete(). This fills the previous role filled by
.decode(..., complete=True).

Closes #554, #396, #394

Co-authored-by: Sam Bull &lt;git@sambull.org&gt;

Co-authored-by: Sam Bull &lt;git@sambull.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Tighten bytes/str boundaries and remove unnecessary coercing (#547)</title>
<updated>2020-12-17T20:09:56+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-17T20:09:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=97cd4031549d363fa34737635eab33491fa718fe'/>
<id>97cd4031549d363fa34737635eab33491fa718fe</id>
<content type='text'>
Now that the project is Python 3 only, the boundaries between bytes and
Unicode strings is more explicit.

This allows removing several unnecessary force_bytes() and
force_unicode() calls that handled differences between Python 2 and
Python 3. All uses of force_unicode() have been removed.

For values that are known to be bytes, use `.decode()` instead. For
values are that known to be str, use `.encode()` instead. This strategy
makes the type explicit and reduces a function call.

Key handling continues to use force_bytes() to allow callers to pass
either bytes or str.

To help enforce bytes/str handling in the future, the `-b` option is
passed to Python when testing. This option will emit a warning if bytes
and str are improperly mixed together.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the project is Python 3 only, the boundaries between bytes and
Unicode strings is more explicit.

This allows removing several unnecessary force_bytes() and
force_unicode() calls that handled differences between Python 2 and
Python 3. All uses of force_unicode() have been removed.

For values that are known to be bytes, use `.decode()` instead. For
values are that known to be str, use `.encode()` instead. This strategy
makes the type explicit and reduces a function call.

Key handling continues to use force_bytes() to allow callers to pass
either bytes or str.

To help enforce bytes/str handling in the future, the `-b` option is
passed to Python when testing. This option will emit a warning if bytes
and str are improperly mixed together.</pre>
</div>
</content>
</entry>
<entry>
<title>Replace force_bytes()/force_unicode() in tests with literals (#541)</title>
<updated>2020-12-17T07:38:14+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-17T07:38:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=db4d2f09a1e5ba0b9fdab49d9e51006c60de2b63'/>
<id>db4d2f09a1e5ba0b9fdab49d9e51006c60de2b63</id>
<content type='text'>
Now that Python 2 has been dropped, can safely use bytes
literals (b"abc") and string literals.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that Python 2 has been dropped, can safely use bytes
literals (b"abc") and string literals.</pre>
</div>
</content>
</entry>
<entry>
<title>Use existing key_path() utility function throughout tests (#540)</title>
<updated>2020-12-17T01:26:47+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-17T01:26:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=6ce4e35a9d373bb969235d99bdb42965e7bba38a'/>
<id>6ce4e35a9d373bb969235d99bdb42965e7bba38a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unnecessary Unicode decoding before json.loads() (#542)</title>
<updated>2020-12-16T22:24:40+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-16T22:24:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=696f65d654d13c1581f396c00f09dd48dfef59b4'/>
<id>696f65d654d13c1581f396c00f09dd48dfef59b4</id>
<content type='text'>
Since Python 3.6, json.loads() accepts both Unicode and byte strings.

https://docs.python.org/3/library/json.html#json.loads

&gt; Changed in version 3.6: s can now be of type bytes or bytearray. The
&gt; input encoding should be UTF-8, UTF-16 or UTF-32.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since Python 3.6, json.loads() accepts both Unicode and byte strings.

https://docs.python.org/3/library/json.html#json.loads

&gt; Changed in version 3.6: s can now be of type bytes or bytearray. The
&gt; input encoding should be UTF-8, UTF-16 or UTF-32.</pre>
</div>
</content>
</entry>
<entry>
<title>Run pyupgrade to simplify code and use Python 3.6 syntax (#536)</title>
<updated>2020-12-16T22:20:03+00:00</updated>
<author>
<name>Jon Dufresne</name>
<email>jon.dufresne@gmail.com</email>
</author>
<published>2020-12-16T22:20:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pyjwt.git/commit/?id=9324d6f007bbd0a48edafe1889d0af7eb0064103'/>
<id>9324d6f007bbd0a48edafe1889d0af7eb0064103</id>
<content type='text'>
pyugrade is a command line tool to automatically update Python syntax to
modern usage and patterns. For additional details, see:

https://github.com/asottile/pyupgrade

Changes made by the tool:

- Use short Python3 super() syntax.
- Use f-strings when they are simple and more readable.
- Drop Python 2 u prefix from strings.
- Drop "r" argument from open(). It is the default and so specifying it is
  unnecessary.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pyugrade is a command line tool to automatically update Python syntax to
modern usage and patterns. For additional details, see:

https://github.com/asottile/pyupgrade

Changes made by the tool:

- Use short Python3 super() syntax.
- Use f-strings when they are simple and more readable.
- Drop Python 2 u prefix from strings.
- Drop "r" argument from open(). It is the default and so specifying it is
  unnecessary.</pre>
</div>
</content>
</entry>
</feed>
