question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Textual has no version dunder

See original GitHub issue

I’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:open
  • Created 10 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jacobtomlinsoncommented, Nov 29, 2022

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.

1reaction
willmcgugancommented, Nov 29, 2022

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found