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

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

Open
chrisjsewell opened this issue Feb 22, 2023 · 14 comments · Fixed by pydata/pydata-sphinx-theme#1264
Open
Labels
bug Something isn't working

Comments

@chrisjsewell
Copy link
Member

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 chrisjsewell added the bug Something isn't working label Feb 22, 2023
@chrisjsewell
Copy link
Member Author

cc @choldgraf

@chrisjsewell
Copy link
Member Author

Good on the whole though cheers 👌

@chrisjsewell
Copy link
Member Author

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
Copy link
Member

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
Copy link
Member

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

@trallard
Copy link

Not sure - but I can look into this tomorrow.

@choldgraf
Copy link
Member

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

@trallard
Copy link

trallard commented Mar 1, 2023

Ah I forgot 😂 looking into this today.

But so far this has not been reported elsewhere

@chrisjsewell
Copy link
Member Author

Yeh not critical, but it is reproducible

@chrisjsewell
Copy link
Member Author

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

@choldgraf
Copy link
Member

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 pydata/pydata-sphinx-theme#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
Copy link

trallard commented Mar 1, 2023

Ok so did some hunting and this was reported in pydata/pydata-sphinx-theme#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
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants