-
Notifications
You must be signed in to change notification settings - Fork 482
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 DocumenterTools as a dev dep in docs/ #1876
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This does a few things: 1. The source links to the DocumenterTools docstrings do not work right now because we Pkg.add it, but we need the source files to be located in a Git repository for gitremote to determine the remote repository. We can work around that by making it a Pkg.develop dependency instead. 2. If we add it as a dev dependency, we can use unreleased branches which declare support for newer Documenter versions, and so we can use the -DEV versions in the Documenter repository now. However, this requires checking out a particular branch (or tag) of DocumenterTools. Pkg.develop can not be used for this since it does not know how to check out specific branches, and will fail as it tries to check out master (which will not be compatible with e.g. 0.28.0-DEV). 3. Since adding it as a local dev dependency is a slightly non-trivial, this creates a separate docs/instantiate.jl script which does the necessary cloning and Pkg environment manipulations, just to make life easier locally and in the CI config.
fredrikekre
reviewed
Jul 14, 2022
Co-authored-by: Fredrik Ekre <[email protected]>
fredrikekre
approved these changes
Jul 14, 2022
mortenpi
commented
Jul 14, 2022
else | ||
run(`git clone -n https://github.com/JuliaDocs/DocumenterTools.jl.git dev/DocumenterTools`) | ||
end | ||
run(`git -C dev/DocumenterTools checkout documenter-v0.1.14+0.28.0-DEV`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also created the relevant tag in the DocumenterTools repo: https://github.com/JuliaDocs/DocumenterTools.jl/releases/tag/documenter-v0.1.14%2B0.28.0-DEV
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This does a few things:
The source links to the DocumenterTools docstrings do not work right now because we Pkg.add it, but we need the source files to be located in a Git repository for gitremote to determine the remote repository. We can work around that by making it a Pkg.develop dependency instead.
If we add it as a dev dependency, we can use unreleased branches which declare support for newer Documenter versions, and so we can use the
-DEV
versions in the Documenter repository now. However, this requires checking out a particular commit (or tag) of DocumenterTools. Pkg.develop can not be used for this since it does not know how to check out specific branches, and will fail as it tries to check out master (which will not be compatible with e.g.0.28.0-DEV
).Since adding it as a local dev dependency is a slightly non-trivial, this creates a separate
docs/instantiate.jl
script which does the necessary cloning and Pkg environment manipulations, just to make life easier locally and in the CI config.Handling a minor release will still be a little tricky. But what I reckon we can do is: (1) prepare the
master
branch of DocumenterTools, which declares compat with Documenter 0.28, (2) updatedocs/instantiate.jl
here to that branch and tag Documenter, and (3) tag the previously prepared commit of DocumenterTools. This way we never have to register a package that depends on a future release of Documenter.Rather than depending on a commit from a side branch, I think it would be better to push custom tags to DocumenterTools for this. That would ensure that the commit will stay around, even if branches get deleted, and so the
git checkout
here should never fail.This will also function as a test case for #1808, since this is an uncommon edge case that we actually handle (including docstrings from a third package in the manual with working source links).