Skip to content
loading...

re: I am kind of baffled by this code in the `__init__.py` file in my Python project. How does this work internally? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: 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 ...
 

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.

code of conduct - report abuse