Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add flake8-typing-imports#1309

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Yobmod merged 1 commit intogitpython-developers:mainfromkasium:flake8-typing-imports
Aug 2, 2021
Merged

Add flake8-typing-imports#1309

Yobmod merged 1 commit intogitpython-developers:mainfromkasium:flake8-typing-imports
Aug 2, 2021

Conversation

kasium
Copy link
Contributor

The idea to include this plugin comes from#1095 . In short, flake8-typing-imports checks if a import fromtyping is possible in a certain python version.

I ran the plugin in your code base, and it'sNOT compatible with <= 3.6.2. You use NamingTuple with defaults and NoReturn which were added in later patches of 3.6. To let in still run I set the minimum version to 3.7.0.

This means, that either we should fix the issues or gitpython needs to drop the support for this version which is anyway deprecated.
This plugin will hopefully prevent that any new issues are added

@kasiumkasium mentioned this pull requestAug 2, 2021
@kasium
Copy link
ContributorAuthor

Output for 3.6.0

git/types.py:7:1: TYP001 guard import by `if TYPE_CHECKING:`: NoReturn (not in 3.6.0, 3.6.1)from typing import (Callable, Dict, NoReturn, Sequence, Tuple, Union, Any, Iterator,       # noqa: F401^git/index/base.py:70:1: TYP001 guard import by `if TYPE_CHECKING:`: NoReturn (not in 3.6.0, 3.6.1)from typing import (Any, BinaryIO, Callable, Dict, IO, Iterable, Iterator, List, NoReturn,^git/index/typ.py:69:5: TYP005 NamedTuple does not support defaults in 3.6.0    ctime_bytes: bytes = pack(">LL", 0, 0)    ^git/index/typ.py:70:5: TYP005 NamedTuple does not support defaults in 3.6.0    mtime_bytes: bytes = pack(">LL", 0, 0)    ^git/index/typ.py:71:5: TYP005 NamedTuple does not support defaults in 3.6.0    dev: int = 0    ^git/index/typ.py:72:5: TYP005 NamedTuple does not support defaults in 3.6.0    inode: int = 0    ^git/index/typ.py:73:5: TYP005 NamedTuple does not support defaults in 3.6.0    uid: int = 0    ^git/index/typ.py:74:5: TYP005 NamedTuple does not support defaults in 3.6.0    gid: int = 0    ^git/index/typ.py:75:5: TYP005 NamedTuple does not support defaults in 3.6.0    size: int = 0    ^git/objects/util.py:25:1: TYP001 guard import by `if TYPE_CHECKING:`: Deque (not in 3.6.0)from typing import (Any, Callable, Deque, Iterator, NamedTuple, overload, Sequence,^git/refs/remote.py:12:1: TYP001 guard import by `if TYPE_CHECKING:`: NoReturn (not in 3.6.0, 3.6.1)from typing import Any, Iterator, NoReturn, Union, TYPE_CHECKING^4     TYP001 guard import by `if TYPE_CHECKING:`: NoReturn (not in 3.6.0, 3.6.1)7     TYP005 NamedTuple does not support defaults in 3.6.011

@Yobmod
Copy link
Contributor

Yobmod commentedAug 2, 2021
edited
Loading

I've set the checks to run :)
Seems useful already!

So we have to decide: Drop 3.6 now, or i'll pull out NamedTuple defaults (there are only a couple of uses) for now.
NoReturn and Deque are available in typing_extensions, so that can be easily fixed.

I was planning to wait until 3.10 released to drop 3.6.
But I see it had it's final release this June and i have noticed big packages already dropping it (numpy and pandas and therefore most of scientific packages).
(Copying to issue for disucssion)

kasium reacted with thumbs up emoji

@YobmodYobmod merged commitd8a6398 intogitpython-developers:mainAug 2, 2021
@kasiumkasium deleted the flake8-typing-imports branchAugust 2, 2021 14:23
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kasium@Yobmod

[8]ページ先頭

©2009-2025 Movatter.jp