-
Notifications
You must be signed in to change notification settings - Fork 133
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 UV for package install and dependency resolution #1016
Conversation
Hi @bmos! Thanks for this PR. It looks like it decreases the Mac runs from about 3m each to 1m. I do wonder whether adding Python 3.11 and 3.12 to the matrix, which we plan to do soon, might cause usage issues again. I don't actually have much visibility into how close we are to the limit for the free tier, so I'll look into that. In the meantime, @bmos are you in our Slack? We'd love for you to join the community there. :) |
Just emailed asking for an invite. Thanks for the nudge. I'd say if 3.8-3.12 is going to be shortly supported, it might make sense to test 3.8, 3.10, and 3.12 on Linux and 3.8 and 3.12 on macOS. Or if Linux runs are basically unlimited just test them all there and just those 2 on macOS. |
I followed up with another email in May and am about to send another. |
Not sure why no one's responding to that email but you can just email me directly at [email protected]. Sorry! |
I'm rebuilding this PR against main, based on our discussion today. |
eea6e39
to
9aa9572
Compare
Rebuilt it again to resolve merge conflicts after 3.12 updates. |
i have added a test which ensures that install works via pip i'm not sure whether it needs to run for every OS/python version pair that we run the usual tests on, so I'd love feedback on that question. if it does, it seems to have removed much of the benefit of this PR (well not removed the benefits but introduced a drawback: CI complexity) |
Can you clarify/rephrase? I'm not sure I understand this question:
|
In test-pip-install.yml, the same set of python versions is defined as in the linting/testing script. Ideally we probably also shouldn't be checking the formatting multiple times. |
Github Actions may have a way to define once and then import. But we could probably get away with testing on the lowest and highest version of Python on each OS. |
So I'd like to get this merged but there may be some conflicts with #1108. I guess once that is merged we can see what comes up? I think for now we can merge and if we end up overdrawing our github actions minutes we can scale back the number of tests we run. |
Great! I got the tests passing again. |
Thanks @bmos! The switch from Black/Flake8 to Ruff has been merged, which unfortunately but not unexpectedly introduced some conflicts. |
Ok! Happy to fix it up again shortly |
3800731
to
49b610e
Compare
Ok I think this is done now 🥳 |
macOS + python 3.8 seems to take a long time because it needs to compile one of the dependencies, but it is still faster. |
I moved the test order to lint, test, format. |
Our old linter (flake8) had overlap with the formatter - do we know if that's the case again here? We don't want a situation where the linter is failing on style issues that the formatter would fix. (Caveat: I am still kind of confused about the scope of the linter vs the formatter, so it's possible my question doesn't make sense.) |
That's a good question, I'll dig into ruff's documentation. |
It appears that the two are supposed to be able to be used without overlap: |
I added the check flag so that it would not actually be reformatting the files and would exit with a failed status. I think that as written the formatter action step would always show a pass even if there were files that needed to be reformatted. |
Did this change accidentally remove our Windows tests? @bmos can you confirm? (If so, this is on me, I should have caught that) |
No, it was already commented out. See the diff. |
But if it's supposed to work on Windows we should absolutely add that. |
Oh jeez I could swear we added Windows tests but I'm finding no evidence in our PR history so maybe I just hallucinated it. Definitely adding Windows tests is a high priority. |
Would it make sense for "Adding Windows tests" to be its own issue? |
I didn't make an issue but I have this mostly done already in a draft PR |
What
uv is "an extremely fast Python package installer and resolver, written in Rust."
Why
Your macOS testing is significantly limited by only testing with python 3.8. Based on the comments in your actions, it seems like this is because macOS actions are much more expensive (and unfortunately that workflow takes even longer to run on macOS than it does on Windows). If the macOS workflow was able to execute faster, you could run more of them without incurring as much additional usage or just save your usage generally.
Your current workflow step of installing dependencies results in a notice:
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime.
Both of these concerns can be addressed by using uv. Using the included linting workflow takes far less time per job compared to the workflow you're using now.
Why Not
uv is very new and relatively unknown compared to pip and does have some behavior differences from pip (such as how it does not default to installing yanked versions -- which could be a positive but is a noteworthy difference).
uv doesn't support python 3.7, which PyPI says parsons does (although parsons tests don't pass under 3.7)