Skip to content

Fix mypy pre-commit settings #148

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

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix mypy pre-commit settings
When proposing #147 I noticed that mypy failed with missing
`types-request` - and while the mypy configuration had
the `--install-types`, it did not work automatically for requests.

The error was:

```
cherry_picker/cherry_picker.py:15: error: Library stubs not installed for
"requests"  [import-untyped]
    import requests
    ^
cherry_picker/cherry_picker.py:15: note: Hint: "python3 -m pip install types-requests"
cherry_picker/cherry_picker.py:15: note: (or run "mypy --install-types" to install all missing stub packages)
cherry_picker/cherry_picker.py:15: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
```

I looked a bit closer and noticed the advice from
https://github.com/pre-commit/mirrors-mypy

> Note that using the --install-types is problematic. Mutating the
pre-commit environment at runtime breaks cache and will break parallel
builds.

This PR fixes the problem by removing `--install-types` and installing
types-requests explicitly as additional-dependencies.

starting
  • Loading branch information
potiuk committed Nov 17, 2024
commit 560605dfdea4bb138622cabc0ba0eafa855beb6d
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ repos:
args:
[
--ignore-missing-imports,
--install-types,
--non-interactive,
--pretty,
--show-error-codes,
.,
]
pass_filenames: false
additional_dependencies: ["types-requests"]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.4
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy