-
Notifications
You must be signed in to change notification settings - Fork 3
build: Add UV and Pip caching #8
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
Conversation
b48d28d
to
5d16928
Compare
Just as a note, all but the 3.9 workflows already ran in around 12 minutes. e.g: But still, getting 3.9 down to the same level is definitely a win! |
What purpose does committing the I understand if we'd be building application, it's great to pin everything to specific versions for consitency. But we're working on a library. So we don't want to pin down our dependencies - we want to give the user the flexibility of using whatever they already have within their environment as long as it fits within the constraints we've defined in I'm not saying we can't have With that said, if we do opt to keep it, I think we need some kind of automation to make sure it's up to date. For instance, we we need to change dependencies or there's a new python release we want to include or ignore. |
As a high level assumption - when users install your library (eg The value is exactly as you say in pinning it for consistency. The build 100% matches what you have locally, and it's always exactly the same. If you mean for users to checkout the medcat project for local dev, then I think the lock is helpful anyway so there's no way people get different results to what you get. My experience here is npm in javascript with package-lock.json, pretty sure it exactly the same. NPM does it automatically by default every time you npm install something, so it's super standard, I'd say basically any web page these days will have a package-lock.json in their repo. To keep consistent, I imagine UV has something to also make it default to updating it, worst case we add a precommit or something to run |
Oh extra - to explain why I put it in, the caching didnt work without it, it errors out saying it needs the lock file. I didn't plan to add it, though I'm pretty sure it's good practice anyway |
I guess my point was that I wasn't quite sure what the target of it was. I.e - like you said - it doesn't get propagated to the end user in any way (and we wouldn't want it to). And the other concern was the fear of it becoming another thing to maintain. Though that's certainly a solveable problem, either through a pre-commit hook or a workflow, or perhaps even something else. With that said, I'm not sure the lock file is necessarily too useful at dev time since (as far as I know) it's not portable on different python versions or OSs or CPU architecture, or with and without GPU ( So it sounds like we'll keep it for:
And I think we should plan a for a way to ensure it's up to date in one way or the other. EDIT: |
MedCAT 2 Test build improved from 20 minutes to 10 minutes.
Using default caching described in https://docs.astral.sh/uv/guides/integration/github/#caching.
Added mandatory uv.lock file, it's good practice anyway. One todo is add a local dev guide, unless I'm missing it.