-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use theme to set all requirements for Crate Sphinx projects #294
Comments
@amotl take a look and let me know what you think. I'm happy to create the PRs and do the work to fix this issue. but I also thought you might like to take a shot? (i.e., to share knowledge/experience) |
I second this, let's make [1] the single source of truth. Shall we explictly say [1] https://github.com/crate/crate-docs-theme/blob/main/setup.py |
In this context, I would also like to reference crate/crate-docs#52. |
|
|
Yeah, I actually meant those referenced at 3., apart from [2a] https://github.com/crate/crate/blob/master/docs/requirements.txt All set! |
@norosa: Do you believe we can close this ticket or is there some more work to do which I might be missing? |
@amotl thanks for all the work! |
I am creating this issue to address the underlying cause of crate/crate-jdbc#342.
Summary of the problem
How dependency resolution is done at build time
When RTD tries to build a Sphinx project, it reads the requirements from
docs/requirements.txt
.See below for examples.
Every
docs/requirements.txt
file specifies thecrate-docs-theme
.Some (most?)
docs/requirements.txt
files also specify additional dependencies (for example, to pin a specific version ofsphinx
)The
crate-docs-theme
package setup.py file includes an install_requires list that also specifies dependencies (for example, to pin a specific version ofsphinx
).Degrees of freedom
The specifications in
docs/requirements.txt
are fixed to the HEAD commit of the branch you are trying to build. There is no way to alter this configuration without updating the HEAD commit.For
main
ormaster
, this typically isn't an issue.For release branches, this will involve a cherry-pick backport. Sometimes, backporting a simple docs configuration change to an older release branch of a software project causes unrelated test failures for the main project code. This can happen when the new test environment that was created to test the PR pulled in newer dependencies that were used before. These newer dependencies may introduce breaking changes, regressions, and so on. This typically requires one of the core project maintainers to spend some time fixing a bunch of unrelated project code tests.
The specifications listed in
setup.py
vary across versions of thecrate-docs-theme
package.When Pip is trying to satisfy the two sets of requirements, the only option at build time is to cycle through older versions of the
crate-docs-theme
package until one is found that does not conflict withdocs/requirements.txt
.Conclusion
Any time
docs/requirements.txt
lists a package already listed as a dependency of thecrate-docs-theme
package (viasetup.py
), you open yourself up to "surprise" builds where RTD selects an old version of the theme. This will result in one or more of the live documentation projects using an out-of-date design (breaking seamless integration with the rest of the website).See Stale header and footer for some documentation variants/versions crate-jdbc#342 for an example of this.
Review of all
docs/requirements.txt
filescrate
crate-tutorials
crate-howtos
crate-clients-tools
crash
admin-ui
crate-python
crate-jdbc
crate-dbal
crate-pdo
crate-npgsql
cloud-tutorials
cloud-howtos
cloud-reference
croud
sql-99
crate-docs
crate-docs-theme
Proposed solution
Premise:
crate-docs-theme
should specify all requirements in the setup.py file and the Sphinx project-specificdocs/requirements.txt
file should only list a single dependency:crate-docs-theme
(not pinned to any version, so the latest is always used).Some of the projects already do this (see above).
To complete this work, I propose that we:
docs/requirements.txt
files so they only specifycrate-docs-theme
as a dependencyProjects needing updates as above:
The theme also needs updating:
crate-docs-theme
However, the
crate-docs-theme
docs/requirements.txt
file is an exception.The
--editable=.
essentially installs thecrate-docs-theme
package from the parent directory, so that you can test changes to theme by building the docs. This line should stay. The next two lines (sphinx
anddocutils
) can probably be removed.The text was updated successfully, but these errors were encountered: