| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Why: To include external sphinxdocs dependencies in docs lockfiles without manually duplicating them in docs/pyproject.toml. How: Add merge_pyproject_deps.py script to merge additional pyproject.toml dependency lists into a main pyproject.toml via a genrule in docs/BUILD.bazel, and pass the merged output to //docs:requirements and //docs:uv_lock.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Sorry, something went wrong.
| --hash=sha256:a97820526f7fbfd2ec1bce83f3f25e3a14840dac0d8e02a0b71cd75db3f77fc9 \ | ||
| --hash=sha256:eeecf07f0c2a93ace0772c92e596ace6d3d3996c042b2128459aaae2a76de11d | ||
| # via rules-python-docs (docs/pyproject.toml) | ||
| # via rules-python-docs (bazel-out/k8-fastbuild-ST-501889d92340/bin/docs/merged/pyproject.toml) |
There was a problem hiding this comment.
This is no-go, IMHO. This is not strictly reproducible.
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, yeah. "not strictly reproducible" is a good way of putting it. Having the merge tool rewrite these would solve that.
Sorry, something went wrong.
| cmd = "$(location :merge_pyproject_deps) --output $@ $(location pyproject.toml) $(location @sphinxdocs//:pyproject.toml)", | ||
| target_compatible_with = _TARGET_COMPATIBLE_WITH, | ||
| tools = [":merge_pyproject_deps"], | ||
| ) |
There was a problem hiding this comment.
Ideally the pyproject.toml uses uv workspaces to create a lock file. Then we include the pyproject.toml via data and it just works.
I think it would be good to figure out how to use https://docs.astral.sh/uv/concepts/projects/dependencies/ for this.
We even have a test that checks that pyproject.toml inclusion is working: https://github.com/bazel-contrib/rules_python/tree/main/tests/uv/lock/workspaces
The very least we can do is use copy_file to bring the pyproject.toml into the current module scope and then include it using workspaces as in the example. The best we could do is to just include it.
Sorry, something went wrong.
There was a problem hiding this comment.
Ohh, interesting. Yeah, workspaces sounds very promising.
Maybe we should add a workspaces arg to the lock() rule? Or something like that. I haven't finished reading the docs, but -- yeah copy_file or something -- I suspect some starlark logic to arrange files so the paths in pyproject are compatible with the bazel invoked uv.
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, +1 to adding an arg.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Currently, to express the starting points of the PyPI dependency graph for documentation lockfiles, all dependencies must be manually listed in docs/pyproject.toml. Because sphinxdocs is an external dependency not published to PyPI, its dependencies previously had to be manually duplicated in docs/pyproject.toml to be included in dependency resolution.
This change automates synthesizing a unified pyproject.toml during lockfile generation by merging additional pyproject.toml dependency lists into the main file before passing the result to the lock targets.