-
Notifications
You must be signed in to change notification settings - Fork 481
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
Overwrite inventory version in deploydocs
#2449
Overwrite inventory version in deploydocs
#2449
Conversation
129c19a
to
bf40a7c
Compare
Per the discussion on Slack, I've revised this so that it takes a A manual inventory version can still be set by passing an explicit In all cases, |
This is required to set the inventory version for the Julia project itself. Also adds (implicit) support for `JuliaProject.toml`. This is not documented, as it's understood that `JuliaProject.toml` is just an alias for `Project.toml`, and not something we want to confuse people with too much.
If `deploydocs` is deploying for a tagged version, verify that that version matches the `version` in the `objects.inv` inventory file. If not, throw an error: The inventory `version` must never contradict what the version-selection-menu shows.
This unconditionally overwrites an existing inventory `version` with the version determined by `deploydocs`. This only happens when `deploydocs` actually knows the version. For `dev`-deployments, an existing `version` is left unchanged. Under normal circumstances, the existing `version` will already be the correct one, so this should do nothing. If the `deploydocs` actually has to *change* the version, that would indicate that something is set up incorrectly, and thus a warning will be printed.
In order to prevent an auto-detected inventory version being incorrect for unusual setups (e.g., monorepo), we only consider a `docs/../Project.toml` file when looking up a version. Everything else will leave the version blank in `makedocs`, respectively require explicitly setting `inventory_version` manually
e3f602b
to
45696e1
Compare
a6cdd06
to
cdac0d3
Compare
* Write inventory files * Add test of inventories * Add documentation * Write only `objects.inv` Removes the code for writing `inventory.toml.gz`. * Fix inventory for md filenames with spaces * Set inventory version (#2449) * Obtain inventory version from Project.toml * Overwrite inventory version in `deploydocs` This unconditionally overwrites an existing inventory `version` with the version determined by `deploydocs`. This only happens when `deploydocs` actually knows the version. For `dev`-deployments, an existing `version` is left unchanged. Under normal circumstances, the existing `version` will already be the correct one, so this should do nothing. If the `deploydocs` actually has to *change* the version, that would indicate that something is set up incorrectly, and thus a warning will be printed. * Restrict inventory version from `Project.toml` to standard setups In order to prevent an auto-detected inventory version being incorrect for unusual setups (e.g., monorepo), we only consider a `docs/../Project.toml` file when looking up a version. Everything else will leave the version blank in `makedocs`, respectively require explicitly setting `inventory_version` manually * Update the CHANGELOG
This unconditionally overwrites an existing inventory
version
with the version determined bydeploydocs
. This only happens whendeploydocs
actually knows the version. Fordev
-deployments, an existingversion
is left unchanged.Under normal circumstances, the existing
version
will already be the correct one, so this should do nothing. If thedeploydocs
actually has to change the version, that would indicate that something is set up incorrectly, and thus a warning will be printed (but noerror
)This PR is just #2442 with the tweak discussed in #2442 (comment). This makes #2442 less breaking: repos that are set up to contain only the documentation for some other package but don't declare the version of that package in some
Project.toml
/VERSION
file won't get anerror
, but instead just a@warn
. Their deployment will continue to work without them having to make any changes to their setup.It satisfies @mortenpi's desire that
deploydocs
should have the last word and unconditionally patch in theversion
if it can determine aversion
from the git tags / the deployment folder name. Ultimately, this PR has the same final outcome as #2448, but the "fallback" is already inmakedocs
so that the inventory has the correctversion
already aftermakedocs
. That also means there is no need for a manualinventory_version
option toHTML
.I'd be quite happy with this compromise.