Textual has no version dunder
See original GitHub issueI’m in the habit of looking for a __version__
dunder when trying to figure out what versions of packages I have installed. I noticed today that textual doesn’t have one.
>>> import textual
>>> textual.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'textual' has no attribute '__version__'
It would be nice if textual followed this convention.
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
No Dunder method __version__ · Issue #928 · ni/nimi-python
The only thing I question is the usefulness of returning only the module version. I believe the vast majority of customers will want...
Read more >Standard way to embed version into Python package?
After 13+ years of writing Python code and managing various packages, I came to the conclusion that DIY is maybe not the best...
Read more >Single-sourcing the package version
Place the value in a simple VERSION text file and have both setup.py and the ... An advantage with this technique is that...
Read more >Python Package Version: the __version__ Attribute - Finxter
Python contains many “Magic Methods/Attributes”. One of these is __version__ commonly called “Dunder version” because of the double underscore before and ...
Read more >Easily Load non-Python Data Files from a Python Package ...
There is no shame in this implementation, but it just feels a bit more hacky, using a dunder (double underscore) variable, getting the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah interesting. Most projects I maintain use versioneer to set/generate the version from git. I’ve never used it in a poetry-specific project though.
The problem was that there was no tool to do this automatically. So pretty much any tool that uses
poetry
won’t have a__version__
.IIRC I tried
importlib.version
in__init__.py
with Rich, but backed out because it was very slow (it enumerates all the packages)!I believe Sebastian Ramirez was working on a Poetry plugin to do this automatically…