jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
195 stars 31 forks source link

Issue with self.css_files attributes? #277

Closed vsoch closed 1 year ago

vsoch commented 1 year ago

This might be a version issue, but I just hit this:

Exception occurred:
  File "/home/runner/.local/lib/python3.10/site-packages/sphinx_immaterial/__init__.py", line 90, in init_css_files
    self.css_files = [
AttributeError: can't set attribute 'css_files'
The full traceback has been saved in /tmp/sphinx-err-hu_d8fkw.log, if you want to report the issue to the developers.

Is it related to Python version or immaterial version? I'm not currently pinning anything. Thank you (and sorry for always opening bugs, I am terrible :laughing: )

2bndy5 commented 1 year ago

If it is a version issue, then it would be useful to know what versions of python, sphinx, and sphinx-immaterial you are using. I suspect this is a Sphinx version problem, but I haven't looked into it yet.

2bndy5 commented 1 year ago

Sphinx v7.2.0 changes (released Aug 17, 2023).

2bndy5 commented 1 year ago

It looks like Sphinx v7.2.0 changed the StandaloneHTMLBuilder.css_files into a "private" member StandaloneHTMLBuilder._css_files in https://github.com/sphinx-doc/sphinx/pull/11582.

vsoch commented 1 year ago

ah so should I pin one version below that for the time being?

2bndy5 commented 1 year ago

I haven't done any testing (to reproduce) yet. For now, you can try pinning to sphinx<7.2. Please report back if that succeeds or not.

2bndy5 commented 1 year ago

I can confirm that sphinx<7.2 works...

In testing my fixes, I've run into some other issues about sphinx v7.2+ that will have to also be addressed in the upcoming PR:

vsoch commented 1 year ago

The first error went away! But I think I might have hit the third error there?

writing output... 
building [html]: targets for 23 source files that are out of date
updating environment: [new config] 23 added, 0 changed, 0 removed

Sphinx parallel build error:
TypeError: _monkey_patch_python_parse_arglist.<locals>.parse_arglist() takes from 1 to 2 positional arguments but 3 were given
make: *** [Makefile:20: html] Error 2
Error: Process completed with exit code 2.
2bndy5 commented 1 year ago

Please use sphinx-immaterial>=0.11.6 for that fix.

vsoch commented 1 year ago

okay my build worked - https://github.com/flux-framework/flux-restful-api/actions/runs/5898442163/job/15999539187 - thanks for the help! I'll watch this issue for next steps.

2bndy5 commented 1 year ago

I have a working fix, but it needs to pass static analysis before we merge and release it. Thanks for reporting this and verifying the culprit was sphinx v7.2.0.

vsoch commented 1 year ago

Thank you!!

2bndy5 commented 1 year ago

Just published sphinx-immaterial v0.11.7 which includes the fix for this.

vsoch commented 1 year ago

You and @jbms are really too notch maintainers. Every time I’ve opened an issue! This is a great project and I’ll try to keep spreading the good word!