It's best practice not to import the code itself inside setup.py in case dependencies etc. aren't available. Using a parsing function to extract __version__ is a bit of cargo culting I use on all my projects to avoid doing so whilst keeping the version defined in a single place.
It's best practice not to import the code itself inside setup.py in case dependencies etc. aren't available. Using a parsing function to extract
__version__
is a bit of cargo culting I use on all my projects to avoid doing so whilst keeping the version defined in a single place.