scipp / copier_template

Copier template for Scipp projects
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Catch importlib error when building docs with sphinx-build manually #182

Closed nvaytet closed 4 months ago

nvaytet commented 4 months ago

In some cases, where a local source for a package (e.g. in the PYTHONPATH) is used instead of a pip install package, the get_version() in the docs/conf.py fails with importlib.metadata.PackageNotFoundError: No package metadata was found for PACKAGE when using sphinx-build directly (instead of going via tox -e docs).

These changes allows one to use sphinx-build directly, which is sometimes needed for debugging purposes.