Skip to content

Conversation

rickeylev
Copy link
Collaborator

Using the sphinx_stardoc rule doesn't work with bzlmod because it refers to the stardoc repo, which was a dev dependency. This means, even if a user's root module has visibility to stardoc, rules_python doesn't.

To fix, make stardoc a non-dev dependency. With bzlmod semantics, stardoc won't actually be loaded unless a user depends on it by using sphinxdocs.

I ran into this while trying to port rules_testing over to sphinxdocs. The pigweed project
recently started using sphinxdocs and didn't run into this problem, but I'm pretty
sure that's because they're using workspace still, which doesn't have the visibility
constraints that bzlmod does.

Using the sphinx_stardoc rule doesn't work with bzlmod because it
refers to the stardoc repo, which was a dev dependency. This means,
even if a user's root module has visibility to stardoc, rules_python
doesn't.

To fix, make stardoc a non-dev dependency. With bzlmod semantics,
stardoc won't actually be loaded unless a user depends on it by
using sphinxdocs.
@rickeylev rickeylev requested a review from aignas as a code owner October 11, 2024 21:48
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Should we add a note in the docs? I think this may force users onto a newer version of stardoc in their own setup.

@rickeylev
Copy link
Collaborator Author

Good point. Done. It'd be nice to be able to avoid it as a non-dev dependency, but I couldn't figure out any clean way to do so.

@rickeylev rickeylev changed the title fix(sphinxdocs): allow using sphinx_stardoc with bzlmod fix(sphinxdocs),deps: allow using sphinx_stardoc with bzlmod; add stardoc 0.6.2 as dependency Oct 15, 2024
@rickeylev rickeylev enabled auto-merge October 15, 2024 04:12
@rickeylev rickeylev added this pull request to the merge queue Oct 15, 2024
Merged via the queue into bazel-contrib:main with commit 5978390 Oct 15, 2024
3 of 4 checks passed
@rickeylev rickeylev deleted the fix.sphinxdocs.bzlmod.external.usage branch October 15, 2024 05:20
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.

2 participants