Skip to content

Conversation

@mmore500
Copy link
Member

@mmore500 mmore500 commented Feb 9, 2026

Summary

This PR fixes potential build failures on Read the Docs by adding a safety check for the assets directory and ensuring setuptools is explicitly listed as a documentation dependency.

Key Changes

  • doc/conf.py: Added os.path.isdir('assets') check before attempting to copy assets during RTD builds to prevent errors when the assets directory doesn't exist
  • doc/requirements.in: Added setuptools as an explicit dependency for documentation builds
  • doc/requirements.txt: Updated lock file to include setuptools>=69.0.0 with its dependency chain

Implementation Details

The assets copy operation on Read the Docs was failing unconditionally. By wrapping it in a directory existence check, the build will now gracefully skip the copy operation if assets are not present, preventing build failures in certain environments or configurations.

The setuptools dependency was added because it's required by pybtex (used by Sphinx) for pkg_resources functionality, and explicitly declaring it ensures consistent builds across different environments.

https://claude.ai/code/session_01T2FE3KjNU3yk8fjoc1WZvt

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
@mmore500 mmore500 changed the title Fix RTD build by adding assets directory check and setuptools dependency Fix RTD build Feb 9, 2026
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
Copy link
Member Author

@mmore500 mmore500 left a comment

Choose a reason for hiding this comment

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

Adds a safety check for copying assets (is folder), and pins setuptools to fix version incompatibility on RTD; RTD builds now; lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants