I get the fact that it checks for dependencies (and their versions) on runtime. But I don't get why it would need to use get_distribution() to get the version of itself. Wouldn't __version__ = 'some_version' suffice?
Technically it gets the version from the named distribution’s metadata - usually the version kwarg to setuptools.setup() in setup.py. This can be different if setup.py dynamically appends SCM information to the hard-coded version number. Take a look at github.com/dave-shawley/setupext-g... for an example.
I get the fact that it checks for dependencies (and their versions) on runtime. But I don't get why it would need to use
get_distribution()
to get the version of itself. Wouldn't__version__ = 'some_version'
suffice?Technically it gets the version from the named distribution’s metadata - usually the version kwarg to setuptools.setup() in setup.py. This can be different if setup.py dynamically appends SCM information to the hard-coded version number. Take a look at github.com/dave-shawley/setupext-g... for an example.
It would suffice. This would just avoid the duplication by only having it set in
setup.py
and reading the value from there.