Skip to content

Commit 68e236e

Browse files
mmore500claude
andauthored
Fix RTD build (#540)
* Fix RTD build: add setuptools dep and guard assets copy The RTD build fails because pybtex imports pkg_resources, which requires setuptools. Modern Python virtualenvs no longer include setuptools by default. Add it as an explicit dependency. Also guard the assets directory copy in conf.py with an existence check to prevent the "cp: cannot stat 'assets'" error. https://claude.ai/code/session_01T2FE3KjNU3yk8fjoc1WZvt * Pin setuptools<72 to retain pkg_resources module setuptools 72+ removed pkg_resources as a bundled module. RTD upgrades setuptools to 82.0.0 before installing our requirements, so the >=69.0.0 constraint was already satisfied. Pinning <72 forces a downgrade to a version that still includes pkg_resources, which pybtex requires. https://claude.ai/code/session_01T2FE3KjNU3yk8fjoc1WZvt * Remove dead assets copy block per review feedback Delete the on_rtd branch that tried to copy a nonexistent assets directory, and simplify to just `if not on_rtd`. Also remove the now-unused subprocess import. https://claude.ai/code/session_01T2FE3KjNU3yk8fjoc1WZvt * Bump sphinxcontrib-bibtex to 2.6.5 and regenerate requirements.txt Replace the setuptools<72 pin with a sphinxcontrib-bibtex upgrade per review feedback. Version 2.6.5 pulls in pybtex 0.26.0 which no longer depends on pkg_resources, fixing the RTD build without needing to pin setuptools. https://claude.ai/code/session_01T2FE3KjNU3yk8fjoc1WZvt --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent d1e77c4 commit 68e236e

3 files changed

Lines changed: 14 additions & 23 deletions

File tree

doc/conf.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import glob
2222
import os
2323
import sphinx_rtd_theme
24-
import subprocess
2524
import sys
2625
import textwrap
2726

@@ -207,12 +206,7 @@
207206
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
208207
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
209208

210-
if on_rtd: # rtd doesn't run Makefile, so we have to copy assets ourself
211-
subprocess.call(
212-
'mkdir -p _build/html/docs/; cp -r assets _build/html/docs/',
213-
shell=True,
214-
)
215-
else: # only import and set the theme if we're building docs locally
209+
if not on_rtd: # only import and set the theme if we're building docs locally
216210
import sphinx_rtd_theme
217211
html_theme = 'sphinx_rtd_theme'
218212
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

doc/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ coverxygen==1.8.1
44
breathe==4.35.0
55
myst-parser==2.0.0
66
sphinx-tippy==0.4.1
7-
sphinxcontrib-bibtex==2.6.1
7+
sphinxcontrib-bibtex==2.6.5

doc/requirements.txt

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.10
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
5-
# pip-compile doc/requirements.in
5+
# pip-compile --output-file=doc/requirements.txt doc/requirements.in
66
#
77
alabaster==0.7.13
88
# via sphinx
@@ -11,16 +11,15 @@ babel==2.13.1
1111
beautifulsoup4==4.12.2
1212
# via sphinx-tippy
1313
breathe==4.35.0
14-
# via -r /tmp/requirements.in
14+
# via -r doc/requirements.in
1515
certifi==2023.11.17
1616
# via requests
1717
charset-normalizer==3.3.2
1818
# via requests
1919
coverxygen==1.8.1
20-
# via -r /tmp/requirements.in
20+
# via -r doc/requirements.in
2121
docutils==0.20.1
2222
# via
23-
# -r /tmp/requirements.in
2423
# breathe
2524
# myst-parser
2625
# pybtex-docutils
@@ -49,10 +48,10 @@ mdit-py-plugins==0.4.0
4948
mdurl==0.1.2
5049
# via markdown-it-py
5150
myst-parser==2.0.0
52-
# via -r /tmp/requirements.in
51+
# via -r doc/requirements.in
5352
packaging==23.2
5453
# via sphinx
55-
pybtex==0.24.0
54+
pybtex==0.26.0
5655
# via
5756
# pybtex-docutils
5857
# sphinxcontrib-bibtex
@@ -69,16 +68,14 @@ requests==2.31.0
6968
# sphinx
7069
# sphinx-tippy
7170
six==1.16.0
72-
# via
73-
# latexcodec
74-
# pybtex
71+
# via latexcodec
7572
snowballstemmer==2.2.0
7673
# via sphinx
7774
soupsieve==2.5
7875
# via beautifulsoup4
7976
sphinx==7.2.6
8077
# via
81-
# -r /tmp/requirements.in
78+
# -r doc/requirements.in
8279
# breathe
8380
# myst-parser
8481
# sphinx-rtd-theme
@@ -91,13 +88,13 @@ sphinx==7.2.6
9188
# sphinxcontrib-qthelp
9289
# sphinxcontrib-serializinghtml
9390
sphinx-rtd-theme==2.0.0
94-
# via -r /tmp/requirements.in
91+
# via -r doc/requirements.in
9592
sphinx-tippy==0.4.1
96-
# via -r /tmp/requirements.in
93+
# via -r doc/requirements.in
9794
sphinxcontrib-applehelp==1.0.7
9895
# via sphinx
99-
sphinxcontrib-bibtex==2.6.1
100-
# via -r /tmp/requirements.in
96+
sphinxcontrib-bibtex==2.6.5
97+
# via -r doc/requirements.in
10198
sphinxcontrib-devhelp==1.0.5
10299
# via sphinx
103100
sphinxcontrib-htmlhelp==2.0.4

0 commit comments

Comments
 (0)