Skip to content

Future annotations#44

Merged
tony merged 4 commits into
masterfrom
future-annotations
Jan 4, 2025
Merged

Future annotations#44
tony merged 4 commits into
masterfrom
future-annotations

Conversation

@tony

@tony tony commented Jan 1, 2025

Copy link
Copy Markdown
Member

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:

PEP 563: https://peps.python.org/pep-0563/

@tony tony force-pushed the future-annotations branch from c9d4bf3 to 0818b6a Compare January 4, 2025 12:33
tony added 2 commits January 4, 2025 07:52
Fixed 80 errors:
- docs/conf.py:
     2 × UP007 (non-pep604-annotation)
     2 × UP037 (quoted-annotation)
     1 × I002 (missing-required-import)
- src/doctest_docutils.py:
    15 × UP007 (non-pep604-annotation)
     2 × UP037 (quoted-annotation)
     2 × TC002 (typing-only-third-party-import)
     1 × I001 (unsorted-imports)
     1 × I002 (missing-required-import)
     1 × TC003 (typing-only-standard-library-import)
- src/docutils_compat.py:
     2 × UP037 (quoted-annotation)
     2 × TC003 (typing-only-standard-library-import)
     1 × I002 (missing-required-import)
     1 × I001 (unsorted-imports)
- src/gp_libs.py:
     1 × I002 (missing-required-import)
- src/linkify_issues.py:
     1 × UP007 (non-pep604-annotation)
     1 × I002 (missing-required-import)
     1 × TC002 (typing-only-third-party-import)
- src/pytest_doctest_docutils.py:
    15 × UP037 (quoted-annotation)
     8 × UP007 (non-pep604-annotation)
     3 × TC003 (typing-only-standard-library-import)
     1 × I002 (missing-required-import)
     1 × I001 (unsorted-imports)
- tests/conftest.py:
     4 × UP007 (non-pep604-annotation)
     1 × TC003 (typing-only-standard-library-import)
     1 × I002 (missing-required-import)
- tests/test_doctest_docutils.py:
     1 × I002 (missing-required-import)
     1 × TC003 (typing-only-standard-library-import)
- tests/test_linkify_issues.py:
     1 × I002 (missing-required-import)
     1 × UP037 (quoted-annotation)
     1 × TC002 (typing-only-third-party-import)
     1 × TC003 (typing-only-standard-library-import)
     1 × I001 (unsorted-imports)
- tests/test_pytest_doctest_docutils.py:
     1 × I002 (missing-required-import)
     1 × TC002 (typing-only-third-party-import)

Found 225 errors (80 fixed, 145 remaining).
10 files reformatted, 1 file left unchanged

uv run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; uv run ruff format .
@tony tony force-pushed the future-annotations branch from b54b823 to 8d3b3ce Compare January 4, 2025 13:52
@tony tony force-pushed the future-annotations branch from 4a9ee78 to d98816b Compare January 4, 2025 14:29
@codecov

codecov Bot commented Jan 4, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 60.03%. Comparing base (54a3fd2) to head (d98816b).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/pytest_doctest_docutils.py 25.00% 3 Missing ⚠️
src/docutils_compat.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   58.91%   60.03%   +1.11%     
==========================================
  Files          10       10              
  Lines         662      633      -29     
==========================================
- Hits          390      380      -10     
+ Misses        272      253      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tony tony merged commit 7bde9dd into master Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant