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

Publically re-export __version__ #3186

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

Conversation

CoolCat467
Copy link
Member

In this pull request, we publicly re-export __version__. This came up when working on python-trio/trio-websocket#193, where some of the unit test code looks at Trio's version for version-dependent things and mypy is not happy about accessing __version__.

Copy link
Contributor

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should encourage importlib.metadata (eg in the newsfragment). But this is fine as a bugfix to something we thought worked.

src/trio/__init__.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00000%. Comparing base (5ca9662) to head (379d9ce).

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

@jakkdl
Copy link
Member

jakkdl commented Jan 15, 2025

IMO we should encourage importlib.metadata (eg in the newsfragment). But this is fine as a bugfix to something we thought worked.

well, it does work currently so this isn't really a bugfix per se. By publicly re-exporting it we're making it part of the official API, so I think perhaps this shouldn't be done at all?

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.

3 participants