sphinx-book-theme icon indicating copy to clipboard operation
sphinx-book-theme copied to clipboard

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

Open chrisjsewell opened this issue 2 years ago • 14 comments

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 avatar Feb 22 '23 15:02 chrisjsewell

cc @choldgraf

chrisjsewell avatar Feb 22 '23 15:02 chrisjsewell

Good on the whole though cheers 👌

chrisjsewell avatar Feb 22 '23 15:02 chrisjsewell

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.

chrisjsewell avatar Feb 22 '23 18:02 chrisjsewell

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 avatar Feb 23 '23 12:02 choldgraf

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

choldgraf avatar Feb 23 '23 12:02 choldgraf

Not sure - but I can look into this tomorrow.

trallard avatar Feb 23 '23 13:02 trallard

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

choldgraf avatar Mar 01 '23 12:03 choldgraf

Ah I forgot 😂 looking into this today.

But so far this has not been reported elsewhere

trallard avatar Mar 01 '23 12:03 trallard

Yeh not critical, but it is reproducible

chrisjsewell avatar Mar 01 '23 12:03 chrisjsewell

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

chrisjsewell avatar Mar 01 '23 12:03 chrisjsewell

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.

choldgraf avatar Mar 01 '23 14:03 choldgraf

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.

trallard avatar Mar 01 '23 20:03 trallard

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!

HealthyPear avatar Mar 22 '23 17:03 HealthyPear

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.

drammock avatar Mar 28 '23 20:03 drammock