Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
+ Coverage 97.43% 97.47% +0.04%
==========================================
Files 3 3
Lines 117 119 +2
==========================================
+ Hits 114 116 +2
Misses 3 3
🚀 New features to boost your workflow:
|
|
I'd strongly prefer keeping If users of the package prefer Looks good otherwise. |
|
I’m 100% convinced that accessing If I don’t completely misremember, I wrote that part of the official packaging guide, and intentionally chose the wording “many projects also choose” to clearly point out that that’s not a standard. I’ve read that discussion, and I’ve had long discussions with Isaac about this: he was focused on the niche use case “have multiple editable versions of packages in an environment and frequently switch between them via If you care about 30ms added import time, you should probably rewrite your tool in not-Python. My firm opinion: anyone who wants runtime versions should engage with the standards process to get runtime metadata. The PyPA is very open to do this, but nobody ever cared enough to make a PEP. |
Also get rid of the
__version__attribute, I really want to discourage people from using that overimportlib.metadata.version. Versions are properties of distributions (PyPI packages), not import packages, and there is a canonical way in the stdlib to retrieve them using the distribution name. This is often the same, but doing things right makes things way less confusing when it isn’t the same.Also regarding
__version_tuple__: If people want a structured version, they can depend onpackagingand parse the version usingpackaging.version.Version. It’s extremely fast and all our packages importpackaginganyway at import time.