Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need dependency on importlib-metadata #114

Closed
1 task done
johnflavin opened this issue Jan 19, 2022 · 5 comments · Fixed by #116
Closed
1 task done

Need dependency on importlib-metadata #114

johnflavin opened this issue Jan 19, 2022 · 5 comments · Fixed by #116

Comments

@johnflavin
Copy link

Issue:

Sphinx 4.4.0 introduced a dependency on the importlib-metadata backport when installed with python < 3.10. (See sphinx-doc/sphinx#10007.) The 4.4.0 conda package does not have that dependency metadata, so installing sphinx 4.4.0 via conda-forge does not install importlib-metadata when it should.

Example:

First make an empty project.

$ conda create -n test -y "sphinx=4.4.0" "python<3.10"
$ conda activate test
$ mkdir test-dir
$ cd test-dir
$ sphinx-quickstart
< accept default options, put in "test" as name, responses don't matter >

The way I have found to trigger an error is to use a non-default theme. So I edit the conf.py to set html_theme = 'my_custom_theme'. It doesn't actually matter what the theme is, I haven't installed it, but it will never be found because of an error.

$ make html
Running Sphinx v4.4.0
loading pickled environment... done

Exception occurred:
  File "/usr/local/Caskroom/miniconda/base/envs/test/lib/python3.9/site-packages/sphinx/theming.py", line 207, in load_external_theme
    theme_entry_points = entry_points(group='sphinx.html_themes')
TypeError: entry_points() got an unexpected keyword argument 'group'
The full traceback has been saved in /var/folders/rn/37gxvfws6mvcyw4x6k18f_8m0000gp/T/sphinx-err-xhwhv03w.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 2

If I then install importlib-metadata, I get the (correct, expected) error about my fake theme.

$ conda install -y importlib-metadata
$ make html
Running Sphinx v4.4.0
loading pickled environment... done

Theme error:
no theme named 'my_custom_theme' found (missing theme.conf?)
make: *** [html] Error 2
@jakirkham
Copy link
Member

Can you please submit a PR to add this to the recipe?

johnflavin added a commit to johnflavin/sphinx-feedstock that referenced this issue Jan 19, 2022
@johnflavin
Copy link
Author

johnflavin commented Jan 19, 2022

@jakirkham I have done this. But I'm in a bit over my head. Because I had to add a # [py<310] selector to the dependency, I had to drop noarch: python, which means I had to modify build configurations for all the platforms. Reeeally not sure I'm doing all this correctly.

@jakirkham
Copy link
Member

Yep, that all sounds correct. Thanks for wading in here 😄

@ChrisBarker-NOAA
Copy link

Just a note:

We got bit my this recently, and have temporarily worked around it by adding import_lib to our dependencies.

Thanks for working on it!

@jakirkham
Copy link
Member

New packages should start building soon. It takes a bit for them to build and mirror to CDN. So would recheck things in ~1hr to give time for those processes to complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants