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

Typing analysis and public type aliases #226

Merged
merged 4 commits into from
May 15, 2023

Conversation

noirbizarre
Copy link
Contributor

Hello 👋🏼

This pull-requests adds:

  • a tox typing task performing type hinting analysis using MyPy
  • rename the flake8.yml workflow into lint.yml (consistent with its name)
  • add MyPy to the Lint workflow
  • exposes some type aliases (so there are not instanciable as expected in Suggest to replace _Context to Context in requests_mock.response. #92 (comment)) for type intended for requests_mock users:
    • requests_mock.Context to use in response callbacks (alias for requests_mock.response._Context)
    • requests_mock.Request to use in response callbacks (alias for requests_mock.request._RequestObjectProxy)
    • requests_mock.Callback[T] to type response callbacks (alias for Callable[[requests_mock.Request, requests_mock.Context], T])
  • fixes all mistyping to requests.Request which are in fact request proxies (typed requests_mock.Request)
  • fixes all MyPy errors including those from requests_mock.contrib

This pull-requests doesn't introduce any functional change (no .py file touched, only .pyi stubs)

Copy link
Owner

@jamielennox jamielennox left a comment

Choose a reason for hiding this comment

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

It's beautiful. A few things in there i had no idea you could do and it has simplified it a lot.

Thank you

@jamielennox jamielennox merged commit fc19034 into jamielennox:master May 15, 2023
7 checks passed
@noirbizarre noirbizarre deleted the style/typing branch May 16, 2023 10:30
renovate bot added a commit to allenporter/pyrainbird that referenced this pull request Jun 11, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [requests-mock](https://requests-mock.readthedocs.io/)
([source](https://togithub.com/jamielennox/requests-mock)) | `==1.10.0`
-> `==1.11.0` |
[![age](https://badges.renovateapi.com/packages/pypi/requests-mock/1.11.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/requests-mock/1.11.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/requests-mock/1.11.0/compatibility-slim/1.10.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/requests-mock/1.11.0/confidence-slim/1.10.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>jamielennox/requests-mock</summary>

###
[`v1.11.0`](https://togithub.com/jamielennox/requests-mock/releases/tag/1.11.0)

[Compare
Source](https://togithub.com/jamielennox/requests-mock/compare/1.10.0...1.11.0)

#### What's Changed

- Upgrade GitHub Actions by
[@&#8203;cclauss](https://togithub.com/cclauss) in
[jamielennox/requests-mock#224
- Typing analysis and public type aliases by
[@&#8203;noirbizarre](https://togithub.com/noirbizarre) in
[jamielennox/requests-mock#226
- Use unittest.mock when available on Python > 3.3 by
[@&#8203;jelly](https://togithub.com/jelly) in
[jamielennox/requests-mock#230
- Tell urllib3 to ignore content length mismatch by
[@&#8203;jamielennox](https://togithub.com/jamielennox) in
[jamielennox/requests-mock#232
- Remove testrepository dependency by
[@&#8203;jamielennox](https://togithub.com/jamielennox) in
[jamielennox/requests-mock#229

#### New Contributors

- [@&#8203;cclauss](https://togithub.com/cclauss) made their first
contribution in
[jamielennox/requests-mock#224
- [@&#8203;noirbizarre](https://togithub.com/noirbizarre) made their
first contribution in
[jamielennox/requests-mock#226
- [@&#8203;jelly](https://togithub.com/jelly) made their first
contribution in
[jamielennox/requests-mock#230

**Full Changelog**:
jamielennox/requests-mock@1.10.0...1.11.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/allenporter/pyrainbird).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants