readthedocs / sphinx-notfound-page

Create a custom 404 page with absolute URLs hardcoded
https://sphinx-notfound-page.readthedocs.io/
MIT License
51 stars 33 forks source link

0.8.3: documentation build still uses `setuptools` #216

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

Despite move pep517 backend from setuptools to flit documentation still uses part of the setuptools

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v6.1.3
WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 443, in load_extension
    mod = import_module(extname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.8/site-packages/sphinx_tabs/__init__.py", line 3, in <module>
    __import__("pkg_resources").declare_namespace(__name__)
ModuleNotFoundError: No module named 'pkg_resources'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 223, in __init__
    self.setup_extension(extension)
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 398, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3.8/site-packages/sphinx/registry.py", line 446, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname,
sphinx.errors.ExtensionError: Could not import extension sphinx_tabs.tabs (exception: No module named 'pkg_resources')

Extension error:
Could not import extension sphinx_tabs.tabs (exception: No module named 'pkg_resources')

'pkg_resources' is part of the setuptools and it should be rplaced by importlib-metadata. You can find examples of such migrations on https://github.com/pypa/setuptools/issues/3279#issuecomment-1106584262

kloczek commented 1 year ago

Just checked and looks like version could be obtained as well straght from notfound.__version__ without use importlib-metadata🤔

humitos commented 1 year ago

It seems the error comes from and external Sphinx extension, sphinx-tabs

humitos commented 1 year ago

I released https://pypi.org/project/sphinx-notfound-page/1.0.0rc1/, please give it a try and let me know if it works fine for your use case.

humitos commented 1 year ago

I released v1.0.0. I hope it works for everybody 🙏🏼