Add a fallback for a missing version file #12
Merged
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.
Right now, whenever you
uv run
something for the first time in a new environment, it’ll run the full Core build process. The Core build process is moderately expensive (~5 minutes) because it compiles all the C libraries from scratch.In the CI, this gets a little weird: in our normal merge queue workflow, the first job builds Core into a wheel, and then the subsequent jobs install Core from that wheel. Each job is essentially a single nox session. But if you naively
uv run nox -t lint
, the sequence is:Building Core from scratch is superfluous, because we already have a wheel. For a merge queue pipeline with 4 jobs, we end up building the library 5 times instead of 1 (the build job runs the build twice).
It's quite possible to skip installing core when
uv run
ning something, but you run into one problem: no version file (because it's added by the build). The code functions fine (because the installed wheel has it), but sphinx and the linters run into issues if the version file is missing because they're looking at the code, not the wheel.This pretty much only shows up in the CI, because folks will have a version file when developing locally (pretty much everyone will start by
uv sync
). This tweak should fix the issue in the CI, where we can get the version number from the installed wheel instead.Tested locally by removing my version file, and setting the
CI
environment variable.