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

Add mypy configuration file that ignores existing errors on a per-file and per-error basis #2424

Merged
merged 33 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d4907fb
Add permissive mypy configuration
namurphy Dec 21, 2023
817140d
Add mypy to pre-commit
namurphy Dec 21, 2023
0e239d8
Remove mypy section in pyproject.toml
namurphy Dec 21, 2023
affee6a
Add mypy.ini
namurphy Dec 21, 2023
4eb64b6
Remove type syntax causing an error
namurphy Dec 21, 2023
5794d63
Skip directories when running mypy with pre-commit
namurphy Dec 21, 2023
231a98c
Be more specific about type: ignore
namurphy Dec 21, 2023
87008ed
Add changelog entry
namurphy Dec 21, 2023
5b7b406
Merge branch 'main' of github.com:PlasmaPy/PlasmaPy into enable-mypy
namurphy Dec 28, 2023
647df4b
Update mypy.ini following change to Quantity annotations
namurphy Dec 28, 2023
dccac87
Use pretty output for mypy
namurphy Dec 28, 2023
4edda60
Add type hints for empty __all__s'
namurphy Dec 28, 2023
9cc0646
Update global settings for mypy
namurphy Dec 28, 2023
1ed4ea8
Typing fix in plasmapy/__init__.py
namurphy Dec 29, 2023
f159a06
Add Quantity type hint annotations
namurphy Dec 29, 2023
62f45df
Add typing stub packages for pandas, requests, & tqdm
namurphy Dec 29, 2023
9683647
Enable quasi-strict mypy setting
namurphy Dec 29, 2023
a3f040b
Raise errors if there are type warnings w/o codes
namurphy Dec 29, 2023
a030df8
Ignore specific typing errors for different subpackages
namurphy Dec 29, 2023
6739b65
Temporarily add script to create mypy.ini sections
namurphy Dec 29, 2023
b03c922
Remove script to add mypy sections
namurphy Dec 29, 2023
9112260
Update errors to ignore with newer version of mypy
namurphy Dec 29, 2023
a42c8b3
Update 2424.trivial.rst
namurphy Dec 29, 2023
b70cda4
Put back the backtick
namurphy Dec 29, 2023
6ae4501
Regenerate requirements file
namurphy Dec 29, 2023
ea8740c
Add error code to ignore
namurphy Dec 29, 2023
9b81a53
Merge branch 'enable-mypy' of github.com:namurphy/PlasmaPy into enabl…
namurphy Dec 29, 2023
badc705
Add more per-file mypy error codes to ignore
namurphy Dec 29, 2023
96122db
Add final missing error code
namurphy Dec 29, 2023
1b5b780
Update comment
namurphy Dec 29, 2023
d263bbf
Add comments about mypy type stubs packages
namurphy Dec 29, 2023
a3bcf0c
Remove mypy from pre-commit
namurphy Dec 29, 2023
9295e10
Merge branch 'main' of github.com:PlasmaPy/PlasmaPy into enable-mypy
namurphy Dec 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ repos:
additional_dependencies:
- tomli

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
exclude: ^docs|^\.jupyter|^\.github

namurphy marked this conversation as resolved.
Show resolved Hide resolved
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
Expand Down
1 change: 1 addition & 0 deletions changelog/2424.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added an initial configuration for ``mypy` that temporarily ignores existing errors.
2 changes: 1 addition & 1 deletion docs/plasmapy_sphinx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def find_mod_objs(modname: str, app: Sphinx = None) -> Dict[str, Dict[str, Any]]
"functions": {"names": []},
"variables": {"names": []},
}
) # type: Dict[str, Dict[str, Any]]
)
for name in names_to_search:
obj = getattr(mod, name)

Expand Down