sphinx-reload
sphinx-reload copied to clipboard
Fixed import of unavailable sphinx_reload during setup
The import sphinx_reload in setup.py causes several problems:
- Each install requirement of
sphinx_reloadbecomes a build requirement as well; when I dopip install -e .for example, I'm hit with aModuleNotFoundErroron the third-party import statements insphinx_reload.py:import livereload - The
sphinx_reloadmodule isn't necesarily available on the path, or it might discover another installedsphinx_reload, messing with the__version__detection.
This PR adresses these issues by instead scanning the module line by line for a __version__ declaration, and evaluates the right hand side of the assignment statement, without importing it (1) and always finding the same file relative to setup.py (2)