sphinx-reload icon indicating copy to clipboard operation
sphinx-reload copied to clipboard

Fixed import of unavailable sphinx_reload during setup

Open Helveg opened this issue 2 years ago • 0 comments

The import sphinx_reload in setup.py causes several problems:

  1. Each install requirement of sphinx_reload becomes a build requirement as well; when I do pip install -e . for example, I'm hit with a ModuleNotFoundError on the third-party import statements in sphinx_reload.py: import livereload
  2. The sphinx_reload module isn't necesarily available on the path, or it might discover another installed sphinx_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)

Helveg avatar Feb 01 '23 10:02 Helveg