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

Deprecate trio.__version__ #3190

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Jan 21, 2025

Follow up to #3186

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00000%. Comparing base (1c6a6a8) to head (6b625e4).
Report is 5 commits behind head on main.

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3190   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             124          124           
  Lines           18460        18538   +78     
  Branches         1216         1221    +5     
===============================================
+ Hits            18460        18538   +78     
Files with missing lines Coverage Δ
src/trio/__init__.py 100.00000% <100.00000%> (ø)
src/trio/_tests/test_trio.py 100.00000% <100.00000%> (ø)

... and 2 files with indirect coverage changes

@A5rocks A5rocks force-pushed the deprecate-dunder-version branch from 73e8a5f to cb3de6a Compare January 21, 2025 05:17
@A5rocks
Copy link
Contributor Author

A5rocks commented Jan 21, 2025

I didn't realize that deprecating an attribute means it can't exist as a type hint... If I did I would have just skipped #3186! But oh well.

@jakkdl
Copy link
Member

jakkdl commented Jan 21, 2025

it's a shame that https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated (available in typing_extensions) is only meant for classes & functions, but with some messing around it might be possible to make it a @property. pyright looks to support it, but not yet mypy.

Also I guess conf.py can be a nice citizen and make use of importlib.metadata itself.

@A5rocks
Copy link
Contributor Author

A5rocks commented Jan 22, 2025

but with some messing around it might be possible to make it a @Property

This would require telling the type checker the module got replaced by a class (which I don't think is possible?)

Updating conf.py makes sense though.

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.

2 participants