DEV Community

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

Collapse
 
daveshawley profile image
dave-shawley

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.