polygon-io / client-python

The official Python client library for the Polygon REST and WebSocket API.
https://polygon-api-client.readthedocs.io/
MIT License
744 stars 204 forks source link

Bump pook from 1.4.3 to 2.0.0 #697

Closed dependabot[bot] closed 6 days ago

dependabot[bot] commented 6 days ago

Bumps pook from 1.4.3 to 2.0.0.

Release notes

Sourced from pook's releases.

v2.0.0

Available on PyPI: https://pypi.org/project/pook/2.0.0/

See h2non/pook#128 for a summary of the breaking changes and how to update your code if you are affected.

  • Breaking change: Remove Response::body's binary parameter and enforce a keyword argument for chunked.

    • The binary parameter is no longer needed since responses are now always byte-encoded in all cases (see below).
    • A keyword argument is now enforced for chunked to ensure unnamed arguments meant for the removed binary parameter cannot be confused as chunked arguments.
  • Only return byte-encoded response bodies, matching the bahviour of all supported client libraries.

    • This is possible because for all supported client libraries, pook mocks the actual response sent to the client library over the wire, which will, in all cases, be bytes. Client libraries that support reading response content as a string or other formats will continue to work as expected, because they'll always be handling bytes from pook.
    • This causes no change to application code for users of pook, except for users of the standard library urllib, for which this also fixed a bug where non-bytes bodies were returned by pook in certain cases. This is impossible in real application code. If you rely on pook to mock urllib responses and have code that handles non-bytes response bodies, that code can be safely deleted (provided the only reason it was there was pook in the first place).
  • Breaking change: Remove Mock::body's binary parameter.

    • This parameter was already unused due to a bug in the code (it was not passed through to the BodyMatcher), so this will not cause any changes to tests that relied on it: it didn't do anything to begin with.
    • The breaking change is simply the removal of the unused parameter, which should be deleted from tests using pook.
    • Pook's code has also been updated to remove all cases where non-bytes objects were being handled. Instead, the body of any interecepted request will always be stored as bytes, and only decoded when necessary for individual downstream matchers (JSON, XML).
  • Correct documentation strings for XMLMatcher and JSONMatcher to no longer suggest they can handle regex matchers.

    • These classes never implemented regex matching.
  • Add a pytest fixture to the package (kudos @​wimglenn)

Changelog

Sourced from pook's changelog.

v2.0.0 / 2024-07-01

See h2non/pook#128 for a summary of the breaking changes and how to update your code if you are affected.

  • Breaking change: Remove Response::body's binary parameter and enforce a keyword argument for chunked.

    • The binary parameter is no longer needed since responses are now always byte-encoded in all cases (see below).
    • A keyword argument is now enforced for chunked to ensure unnamed arguments meant for the removed binary parameter cannot be confused as chunked arguments.
  • Only return byte-encoded response bodies, matching the bahviour of all supported client libraries.

    • This is possible because for all supported client libraries, pook mocks the actual response sent to the client library over the wire, which will, in all cases, be bytes. Client libraries that support reading response content as a string or other formats will continue to work as expected, because they'll always be handling bytes from pook.
    • This causes no change to application code for users of pook, except for users of the standard library urllib, for which this also fixed a bug where non-bytes bodies were returned by pook in certain cases. This is impossible in real application code. If you rely on pook to mock urllib responses and have code that handles non-bytes response bodies, that code can be safely deleted (provided the only reason it was there was pook in the first place).
  • Breaking change: Remove Mock::body's binary parameter.

    • This parameter was already unused due to a bug in the code (it was not passed through to the BodyMatcher), so this will not cause any changes to tests that relied on it: it didn't do anything to begin with.
    • The breaking change is simply the removal of the unused parameter, which should be deleted from tests using pook.
    • Pook's code has also been updated to remove all cases where non-bytes objects were being handled. Instead, the body of any interecepted request will always be stored as bytes, and only decoded when necessary for individual downstream matchers (JSON, XML).
  • Correct documentation strings for XMLMatcher and JSONMatcher to no longer suggest they can handle regex matchers.

    • These classes never implemented regex matching.
  • Add a pytest fixture to the package.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)