这是indexloc提供的服务,不要输入任何密码
Skip to content

Add a fallback for a missing version file #12

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

Merged
merged 1 commit into from
Jul 24, 2025
Merged

Conversation

Maegereg
Copy link
Contributor

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:

  • Build Core from scratch
  • Call nox
  • Install Core from a wheel
  • Run the linters.

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 running 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.

@Maegereg Maegereg requested a review from tmager July 24, 2025 19:08
@Maegereg Maegereg self-assigned this Jul 24, 2025
@Maegereg Maegereg merged commit affa411 into main Jul 24, 2025
@Maegereg Maegereg deleted the dasm/version-import branch July 24, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants