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

Use future annotations #324

Merged
merged 4 commits into from
Jan 4, 2025
Merged

Use future annotations #324

merged 4 commits into from
Jan 4, 2025

Conversation

tony
Copy link
Member

@tony tony commented Jan 4, 2025

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/

Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.76%. Comparing base (669e973) to head (dffbe5a).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #324      +/-   ##
==========================================
+ Coverage   75.37%   75.76%   +0.39%     
==========================================
  Files           5        5              
  Lines         268      260       -8     
==========================================
- Hits          202      197       -5     
+ Misses         66       63       -3     

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

tony added 2 commits January 4, 2025 07:54
Fixed 19 errors:
- docs/conf.py:
    2 × UP007 (non-pep604-annotation)
    2 × UP037 (quoted-annotation)
    1 × I002 (missing-required-import)
    1 × I001 (unsorted-imports)
- src/cihai_cli/__about__.py:
    1 × I002 (missing-required-import)
- src/cihai_cli/cli.py:
    4 × UP007 (non-pep604-annotation)
    1 × F401 (unused-import)
    1 × I002 (missing-required-import)
- tests/conftest.py:
    1 × I002 (missing-required-import)
    1 × UP037 (quoted-annotation)
- tests/test_cli.py:
    1 × TC003 (typing-only-standard-library-import)
    1 × I002 (missing-required-import)
    1 × UP037 (quoted-annotation)
    1 × I001 (unsorted-imports)

Found 63 errors (19 fixed, 44 remaining).
4 files reformatted, 3 files 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 6714954 to ddac480 Compare January 4, 2025 13:54
@tony tony force-pushed the future-annotations branch from dab9ad2 to dffbe5a Compare January 4, 2025 15:27
@tony tony merged commit cf230d2 into master Jan 4, 2025
9 checks passed
@tony tony deleted the future-annotations branch January 4, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant