implementing --version with importlib.metadata (intermediate) anthony explains #041

preview_player
Показать описание


==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

Great videos, thank you. One question though, is there a reason why you don't store the version in the source file and use the attr directive of setuptools? This way you avoid adding a runtime dependency on importlib-metadata in py37 and below.
I usually define a `__version__` variable in `mymodule.py` (or `mypackage/__init__.py`) and have `version = attr: mymodule.__version__` (or `mypackage.__version__`) in setup.cfg metadata.

ali.hamdan