Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pook from 1.4.3 to 2.0.0 #697

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 1, 2024

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 <dependency name> 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)

Bumps [pook](https://github.com/h2non/pook) from 1.4.3 to 2.0.0.
- [Release notes](https://github.com/h2non/pook/releases)
- [Changelog](https://github.com/h2non/pook/blob/master/History.rst)
- [Commits](h2non/pook@v1.4.3...v2.0.0)

---
updated-dependencies:
- dependency-name: pook
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jul 1, 2024
Copy link
Contributor

@justinpolygon justinpolygon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@justinpolygon justinpolygon merged commit ceeb56d into master Jul 1, 2024
9 checks passed
@justinpolygon justinpolygon deleted the dependabot/pip/pook-2.0.0 branch July 1, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant