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

Restore compatibility with python<3.11 by only importing typing.Self under if TPYE_CHECKING #2221

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

AdeelH
Copy link
Collaborator

@AdeelH AdeelH commented Aug 12, 2024

Overview

typing.Self is only available in python>=3.11. v0.31.1 therefore broke compatibility with earlier python versions by making use of it in type hints. This PR moves the import of typing.Self to if TYPE_CHECKING blocks to fix that.

Checklist

  • Added unit tests, if applicable
  • Updated documentation, if applicable
  • Added needs-backport label if the change should be back-ported to the previous release
  • PR has a name that won't get you publicly shamed for vagueness

Notes

N/A

Testing Instructions

N/A

typing.Self is only available in python >=3.11, so this makes the codebase compatible with earlier python versions again
@AdeelH AdeelH added the needs-backport This PR needs to be backported to release branches label Aug 12, 2024
@AdeelH AdeelH changed the title Restore compatibility with python<3.11 by only importing typing.Self under TPYE_CHECKING Restore compatibility with python<3.11 by only importing typing.Self under if TPYE_CHECKING Aug 12, 2024
@AdeelH AdeelH merged commit 1f3b91a into azavea:master Aug 13, 2024
2 checks passed
@AdeelH AdeelH deleted the self branch August 13, 2024 13:58
AdeelH added a commit to AdeelH/raster-vision that referenced this pull request Aug 29, 2024
typing.Self is only available in python >=3.11, so this makes the codebase compatible with earlier python versions again
AdeelH added a commit that referenced this pull request Aug 30, 2024
typing.Self is only available in python >=3.11, so this makes the codebase compatible with earlier python versions again
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.34%. Comparing base (546297f) to head (bc4dd97).
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2221   +/-   ##
=======================================
  Coverage   90.34%   90.34%           
=======================================
  Files         199      199           
  Lines        9910     9910           
=======================================
  Hits         8953     8953           
  Misses        957      957           

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport This PR needs to be backported to release branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant