executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
431 stars 197 forks source link

On rebuilds: `WARNING: Color theme None not found by pygments` #690

Open chrisjsewell opened 1 year ago

chrisjsewell commented 1 year ago

Heya, just tried updating myst-parser to sphinx-book-theme==1.0.0rc2, but now on rebuilds I get 😢 :

WARNING: Color theme None not found by pygments, falling back to tango.
WARNING: Color theme None not found by pygments, falling back to monokai.

Not very informative, but managed to hunt down the warning to:

https://github.com/pydata/pydata-sphinx-theme/blame/0c0d6ca130953ac92ce454ea2d11167d7373e76d/src/pydata_sphinx_theme/__init__.py#L911

I'll leave you guys to deal with upstreaming the problem, I would also suggest that the warning be changed, to indicate that it's from pydata-sphinx-theme, and even give it a type/subtype to suppress

chrisjsewell commented 1 year ago

cc @choldgraf

chrisjsewell commented 1 year ago

Good on the whole though cheers 👌

chrisjsewell commented 1 year ago

Note, I think it only happens on rebuilds where nothing changes:

building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
Writing redirects...
WARNING: Color theme None not found by pygments, falling back to tango.
WARNING: Color theme None not found by pygments, falling back to monokai.
build finished with problems, 2 warnings.
choldgraf commented 1 year ago

Interesting - I wonder if the pygments themes aren't being added to the build because they are depending on a sphinx event that sometimes does not trigger or something 🤔

choldgraf commented 1 year ago

@trallard do you have any idea why we would be seeing this error in the book theme?

trallard commented 1 year ago

Not sure - but I can look into this tomorrow.

choldgraf commented 1 year ago

@trallard did you get a chance to look into this? has it been reported in any other projects that use these pygments stylings?

trallard commented 1 year ago

Ah I forgot 😂 looking into this today.

But so far this has not been reported elsewhere

chrisjsewell commented 1 year ago

Yeh not critical, but it is reproducible

chrisjsewell commented 1 year ago

Myst-parser is using rc2 at the moment btw: https://myst-parser.readthedocs.io/ 😄

choldgraf commented 1 year ago

On the pydata theme I wasn't able to reproduce this (ie, by building the docs once, then re-building them immediately, though I did find this bug https://github.com/pydata/pydata-sphinx-theme/issues/1222). I was able to reproduce it on the sphinx-book-theme. So for some reason something different is happening in this theme than in the pydata theme.

trallard commented 1 year ago

Ok so did some hunting and this was reported in https://github.com/pydata/pydata-sphinx-theme/issues/1081

Which resolved by adding accessible-pygments as a full dependency to the theme.

I think we could improve the warning upstream - but in any case this should be fixed if the Pydata Sphinx theme version used is upgraded.

HealthyPear commented 1 year ago

I have the same problem on a simple sphinx-build using pydata-sphinx-theme, but I checked and in my environment I have accessible-pygments...

any news on this? it seems to be also erratic: 5' ago I didn't see it and now it popped out again!

drammock commented 1 year ago

I think this should be fixed now by pydata/pydata-sphinx-theme#1264. Hopefully now nobody ever sees that warning unless they actually request a pygments theme that doesn't exist.