-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Enable Ruff SIM #13309
Open
Avasam
wants to merge
12
commits into
python:main
Choose a base branch
from
Avasam:Ruff-SIM
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+30
−186
Open
Enable Ruff SIM #13309
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eee5ab1
Enable Ruff SIM
Avasam a96249e
Work around PYI002+SIM114 incompatibility
Avasam 1daf81f
Disable SIM102 and SIM108
Avasam 6126a6a
Merge branch 'main' of https://github.com/python/typeshed into Ruff-SIM
Avasam 7d5868e
Disable SIM110
Avasam 93d24f8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 570c84c
Merge branch 'main' into Ruff-SIM
Avasam 892301b
Apply suggestions from code review
Avasam 818c0d3
More specific SIM selection
Avasam b7e39ea
Merge branch 'main' of https://github.com/python/typeshed into Ruff-SIM
Avasam b40aa9b
Expand SIM2
Avasam c52feda
typo
Avasam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,9 +240,7 @@ OP_SINGLE_ECDH_USE: int | |
OP_NO_COMPRESSION: int | ||
OP_ENABLE_MIDDLEBOX_COMPAT: int | ||
OP_NO_RENEGOTIATION: int | ||
if sys.version_info >= (3, 11): | ||
OP_IGNORE_UNEXPECTED_EOF: int | ||
elif sys.version_info >= (3, 8) and sys.platform == "linux": | ||
if sys.version_info >= (3, 11) or sys.platform == "linux": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
OP_IGNORE_UNEXPECTED_EOF: int | ||
if sys.version_info >= (3, 12): | ||
OP_LEGACY_SERVER_CONNECT: int | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -410,93 +410,6 @@ if sys.platform == "win32": | |
"WindowsSelectorEventLoopPolicy", # from windows_events | ||
"WindowsProactorEventLoopPolicy", # from windows_events | ||
) | ||
elif sys.version_info >= (3, 10): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently the 3.9 and 3.10 branches were duplicate (manual fix) |
||
__all__ = ( | ||
"BaseEventLoop", # from base_events | ||
"Server", # from base_events | ||
"coroutine", # from coroutines | ||
"iscoroutinefunction", # from coroutines | ||
"iscoroutine", # from coroutines | ||
"AbstractEventLoopPolicy", # from events | ||
"AbstractEventLoop", # from events | ||
"AbstractServer", # from events | ||
"Handle", # from events | ||
"TimerHandle", # from events | ||
"get_event_loop_policy", # from events | ||
"set_event_loop_policy", # from events | ||
"get_event_loop", # from events | ||
"set_event_loop", # from events | ||
"new_event_loop", # from events | ||
"get_child_watcher", # from events | ||
"set_child_watcher", # from events | ||
"_set_running_loop", # from events | ||
"get_running_loop", # from events | ||
"_get_running_loop", # from events | ||
"CancelledError", # from exceptions | ||
"InvalidStateError", # from exceptions | ||
"TimeoutError", # from exceptions | ||
"IncompleteReadError", # from exceptions | ||
"LimitOverrunError", # from exceptions | ||
"SendfileNotAvailableError", # from exceptions | ||
"Future", # from futures | ||
"wrap_future", # from futures | ||
"isfuture", # from futures | ||
"Lock", # from locks | ||
"Event", # from locks | ||
"Condition", # from locks | ||
"Semaphore", # from locks | ||
"BoundedSemaphore", # from locks | ||
"BaseProtocol", # from protocols | ||
"Protocol", # from protocols | ||
"DatagramProtocol", # from protocols | ||
"SubprocessProtocol", # from protocols | ||
"BufferedProtocol", # from protocols | ||
"run", # from runners | ||
"Queue", # from queues | ||
"PriorityQueue", # from queues | ||
"LifoQueue", # from queues | ||
"QueueFull", # from queues | ||
"QueueEmpty", # from queues | ||
"StreamReader", # from streams | ||
"StreamWriter", # from streams | ||
"StreamReaderProtocol", # from streams | ||
"open_connection", # from streams | ||
"start_server", # from streams | ||
"create_subprocess_exec", # from subprocess | ||
"create_subprocess_shell", # from subprocess | ||
"Task", # from tasks | ||
"create_task", # from tasks | ||
"FIRST_COMPLETED", # from tasks | ||
"FIRST_EXCEPTION", # from tasks | ||
"ALL_COMPLETED", # from tasks | ||
"wait", # from tasks | ||
"wait_for", # from tasks | ||
"as_completed", # from tasks | ||
"sleep", # from tasks | ||
"gather", # from tasks | ||
"shield", # from tasks | ||
"ensure_future", # from tasks | ||
"run_coroutine_threadsafe", # from tasks | ||
"current_task", # from tasks | ||
"all_tasks", # from tasks | ||
"_register_task", # from tasks | ||
"_unregister_task", # from tasks | ||
"_enter_task", # from tasks | ||
"_leave_task", # from tasks | ||
"to_thread", # from threads | ||
"BaseTransport", # from transports | ||
"ReadTransport", # from transports | ||
"WriteTransport", # from transports | ||
"Transport", # from transports | ||
"DatagramTransport", # from transports | ||
"SubprocessTransport", # from transports | ||
"SelectorEventLoop", # from windows_events | ||
"ProactorEventLoop", # from windows_events | ||
"IocpProactor", # from windows_events | ||
"DefaultEventLoopPolicy", # from windows_events | ||
"WindowsSelectorEventLoopPolicy", # from windows_events | ||
"WindowsProactorEventLoopPolicy", # from windows_events | ||
) | ||
elif sys.version_info >= (3, 9): | ||
__all__ = ( | ||
"BaseEventLoop", # from base_events | ||
|
@@ -1059,97 +972,6 @@ else: | |
"ThreadedChildWatcher", # from unix_events | ||
"DefaultEventLoopPolicy", # from unix_events | ||
) | ||
elif sys.version_info >= (3, 10): | ||
__all__ = ( | ||
"BaseEventLoop", # from base_events | ||
"Server", # from base_events | ||
"coroutine", # from coroutines | ||
"iscoroutinefunction", # from coroutines | ||
"iscoroutine", # from coroutines | ||
"AbstractEventLoopPolicy", # from events | ||
"AbstractEventLoop", # from events | ||
"AbstractServer", # from events | ||
"Handle", # from events | ||
"TimerHandle", # from events | ||
"get_event_loop_policy", # from events | ||
"set_event_loop_policy", # from events | ||
"get_event_loop", # from events | ||
"set_event_loop", # from events | ||
"new_event_loop", # from events | ||
"get_child_watcher", # from events | ||
"set_child_watcher", # from events | ||
"_set_running_loop", # from events | ||
"get_running_loop", # from events | ||
"_get_running_loop", # from events | ||
"CancelledError", # from exceptions | ||
"InvalidStateError", # from exceptions | ||
"TimeoutError", # from exceptions | ||
"IncompleteReadError", # from exceptions | ||
"LimitOverrunError", # from exceptions | ||
"SendfileNotAvailableError", # from exceptions | ||
"Future", # from futures | ||
"wrap_future", # from futures | ||
"isfuture", # from futures | ||
"Lock", # from locks | ||
"Event", # from locks | ||
"Condition", # from locks | ||
"Semaphore", # from locks | ||
"BoundedSemaphore", # from locks | ||
"BaseProtocol", # from protocols | ||
"Protocol", # from protocols | ||
"DatagramProtocol", # from protocols | ||
"SubprocessProtocol", # from protocols | ||
"BufferedProtocol", # from protocols | ||
"run", # from runners | ||
"Queue", # from queues | ||
"PriorityQueue", # from queues | ||
"LifoQueue", # from queues | ||
"QueueFull", # from queues | ||
"QueueEmpty", # from queues | ||
"StreamReader", # from streams | ||
"StreamWriter", # from streams | ||
"StreamReaderProtocol", # from streams | ||
"open_connection", # from streams | ||
"start_server", # from streams | ||
"open_unix_connection", # from streams | ||
"start_unix_server", # from streams | ||
"create_subprocess_exec", # from subprocess | ||
"create_subprocess_shell", # from subprocess | ||
"Task", # from tasks | ||
"create_task", # from tasks | ||
"FIRST_COMPLETED", # from tasks | ||
"FIRST_EXCEPTION", # from tasks | ||
"ALL_COMPLETED", # from tasks | ||
"wait", # from tasks | ||
"wait_for", # from tasks | ||
"as_completed", # from tasks | ||
"sleep", # from tasks | ||
"gather", # from tasks | ||
"shield", # from tasks | ||
"ensure_future", # from tasks | ||
"run_coroutine_threadsafe", # from tasks | ||
"current_task", # from tasks | ||
"all_tasks", # from tasks | ||
"_register_task", # from tasks | ||
"_unregister_task", # from tasks | ||
"_enter_task", # from tasks | ||
"_leave_task", # from tasks | ||
"to_thread", # from threads | ||
"BaseTransport", # from transports | ||
"ReadTransport", # from transports | ||
"WriteTransport", # from transports | ||
"Transport", # from transports | ||
"DatagramTransport", # from transports | ||
"SubprocessTransport", # from transports | ||
"SelectorEventLoop", # from unix_events | ||
"AbstractChildWatcher", # from unix_events | ||
"SafeChildWatcher", # from unix_events | ||
"FastChildWatcher", # from unix_events | ||
"PidfdChildWatcher", # from unix_events | ||
"MultiLoopChildWatcher", # from unix_events | ||
"ThreadedChildWatcher", # from unix_events | ||
"DefaultEventLoopPolicy", # from unix_events | ||
) | ||
elif sys.version_info >= (3, 9): | ||
__all__ = ( | ||
"BaseEventLoop", # from base_events | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be
but as asked I explicitly selected them individually