Open rasbt opened 11 months ago
Sure, I could consider adding this. Note you can use importlib.metadata.version("tiktoken")
Thanks for the response. Yes, this works. I was just mentioning the additional .__version__
attribute since it is a common convention in the Python scientific computing ecosystem (SciPy, PyTorch, NumPy, matplotlib, ...).
Since you are using a .toml, it's actually probably best to use the following code you suggested itself
import importlib.metadata
__version__ = importlib.metadata.version("mypackage")
and just add it to the __init__.py
I added a PR for your convenience here: #191
FYI- In the Flask community, we've been removing version from packages now that importlib is around. Maybe scientific packages are keeping it around, but web packages are moving away from it.
It would be nice to add a
__version__
attribute similar to other Python projects, so that we can easily query the version for reproducibility reasons. I.e.,