-
Notifications
You must be signed in to change notification settings - Fork 108
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
Use future annotations #555
Merged
Merged
Conversation
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #555 +/- ##
==========================================
- Coverage 88.76% 88.68% -0.08%
==========================================
Files 36 36
Lines 3934 3924 -10
Branches 360 362 +2
==========================================
- Hits 3492 3480 -12
Misses 307 307
- Partials 135 137 +2 ☔ View full report in Codecov by Sentry. |
Fixed 606 errors: - conftest.py: 1 × TC003 (typing-only-standard-library-import) 1 × I002 (missing-required-import) - docs/conf.py: 2 × UP007 (non-pep604-annotation) 2 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - src/libtmux/__about__.py: 1 × I002 (missing-required-import) - src/libtmux/__init__.py: 1 × I002 (missing-required-import) - src/libtmux/_internal/dataclasses.py: 1 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - src/libtmux/_internal/query_list.py: 47 × UP037 (quoted-annotation) 37 × UP007 (non-pep604-annotation) 1 × I002 (missing-required-import) - src/libtmux/_vendor/_structures.py: 1 × I002 (missing-required-import) 1 × UP037 (quoted-annotation) - src/libtmux/_vendor/version.py: 12 × UP007 (non-pep604-annotation) 5 × UP037 (quoted-annotation) 1 × F401 (unused-import) 1 × I002 (missing-required-import) - src/libtmux/common.py: 8 × UP007 (non-pep604-annotation) 2 × F401 (unused-import) 1 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) 1 × TC003 (typing-only-standard-library-import) - src/libtmux/constants.py: 1 × I002 (missing-required-import) - src/libtmux/exc.py: 7 × UP007 (non-pep604-annotation) 1 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - src/libtmux/formats.py: 1 × I002 (missing-required-import) - src/libtmux/neo.py: 129 × UP007 (non-pep604-annotation) 9 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - src/libtmux/pane.py: 55 × UP007 (non-pep604-annotation) 20 × UP037 (quoted-annotation) 2 × Q000 (bad-quotes-inline-string) 1 × I002 (missing-required-import) - src/libtmux/pytest_plugin.py: 1 × UP037 (quoted-annotation) 1 × TC003 (typing-only-standard-library-import) 1 × I002 (missing-required-import) 1 × I001 (unsorted-imports) - src/libtmux/server.py: 23 × UP007 (non-pep604-annotation) 7 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - src/libtmux/session.py: 29 × UP007 (non-pep604-annotation) 20 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) 1 × I001 (unsorted-imports) - src/libtmux/test.py: 7 × UP037 (quoted-annotation) 5 × UP007 (non-pep604-annotation) 3 × I001 (unsorted-imports) 2 × TC003 (typing-only-standard-library-import) 1 × F401 (unused-import) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) 1 × PYI034 (non-self-return-type) - src/libtmux/window.py: 52 × UP007 (non-pep604-annotation) 22 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - tests/_internal/test_query_list.py: 3 × UP007 (non-pep604-annotation) 1 × I002 (missing-required-import) 1 × I001 (unsorted-imports) 1 × TC003 (typing-only-standard-library-import) - tests/legacy_api/test_common.py: 4 × UP007 (non-pep604-annotation) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/legacy_api/test_pane.py: 1 × I001 (unsorted-imports) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) - tests/legacy_api/test_server.py: 1 × I001 (unsorted-imports) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) - tests/legacy_api/test_session.py: 1 × I001 (unsorted-imports) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/legacy_api/test_tmuxobject.py: 1 × I001 (unsorted-imports) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/legacy_api/test_version.py: 2 × UP007 (non-pep604-annotation) 2 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - tests/legacy_api/test_window.py: 1 × I001 (unsorted-imports) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/test_common.py: 4 × UP007 (non-pep604-annotation) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) - tests/test_dataclasses.py: 1 × TC003 (typing-only-standard-library-import) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) 1 × I001 (unsorted-imports) - tests/test_pane.py: 1 × I001 (unsorted-imports) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) - tests/test_pytest_plugin.py: 1 × I001 (unsorted-imports) 1 × I002 (missing-required-import) 1 × TC002 (typing-only-third-party-import) - tests/test_server.py: 1 × I001 (unsorted-imports) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/test_session.py: 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/test_test.py: 1 × I002 (missing-required-import) - tests/test_tmuxobject.py: 1 × I001 (unsorted-imports) 1 × TC001 (typing-only-first-party-import) 1 × I002 (missing-required-import) - tests/test_version.py: 2 × UP007 (non-pep604-annotation) 2 × UP037 (quoted-annotation) 1 × I002 (missing-required-import) - tests/test_window.py: 1 × I001 (unsorted-imports) 1 × I002 (missing-required-import) 1 × TC001 (typing-only-first-party-import) Found 1976 errors (606 fixed, 1370 remaining). 35 files reformatted, 9 files left unchanged uv run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; uv run ruff format .
23fe1c6
to
bb13d70
Compare
Fixed 6 errors: - src/libtmux/_vendor/version.py: 1 × I001 (unsorted-imports) 1 × UP006 (non-pep585-annotation) - src/libtmux/test.py: 2 × I001 (unsorted-imports) 1 × UP006 (non-pep585-annotation) 1 × TC003 (typing-only-standard-library-import) Found 1374 errors (6 fixed, 1368 remaining). 44 files left unchanged uv run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; uv run ruff format .
735c73b
to
08ffc8b
Compare
08ffc8b
to
aa5e23f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
chore: Support PEP 563
from __future__ import annotations
Using PEP 563's deferred resolution of annotations avoids the computation cost of symbols we imported solely used for type-checking.
Ruff:
non-pep585-annotation (UP006)
non-pep604-annotation (UP007)
PEP 563: https://peps.python.org/pep-0563/