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

Fix AttributeError when one of css_files is a string #1537

Merged
merged 1 commit into from Oct 30, 2023

Conversation

mitya57
Copy link
Contributor

@mitya57 mitya57 commented Oct 28, 2023

Unfortunately, the last version of #1528 still did not work properly in some cases.

When css_files comes from Sphinx, every item of this list is an instance of _CascadingStyleSheet class, and css_tag works with it.

However, some projects override css_files in their templates:

or pass css_files to HTML context explicitly from conf.py:

To make build of these projects succeed, we need to support css_file being a string.
Here I copied the logic from Sphinx itself.

See this Debian bug for the logs of the failed builds.

@mitya57 mitya57 requested a review from a team as a code owner October 28, 2023 12:53
Copy link
Collaborator

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah, I thought we were about ready for a 2.0 release too. Thanks for the heads up and the keen eye on this @mitya57

The changes here look good to me. I don't have any strong input on the most correct logic to use here either though. But we are back to close to what we had originally, so I would assume we are in a safer place.

I was going to put out 2.0 tomorrow, but I'll aim for a 2.0rc4 today instead.

@agjohnson agjohnson merged commit 4498e97 into readthedocs:master Oct 30, 2023
8 checks passed
@mitya57 mitya57 deleted the css-files branch October 30, 2023 18:46
@agjohnson
Copy link
Collaborator

2.0.0rc4 is now out!

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

Successfully merging this pull request may close these issues.

None yet

2 participants