move-coop / parsons

A python library of connectors for the progressive community.
Other
255 stars 125 forks source link

Use UV for package install and dependency resolution #1016

Open bmos opened 3 months ago

bmos commented 3 months ago

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)

shaunagm commented 2 months ago

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. :)

bmos commented 2 months ago

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. The most important tests are the oldest and newest versions as they're the ones most likely to support some syntax+dependencies and not others.

bmos commented 1 week ago

I followed up with another email in May and am about to send another. Am I emailing the wrong place? engineering+parsons [at] movementcooperative.org ?

shaunagm commented 1 week ago

Not sure why no one's responding to that email but you can just email me directly at shaunagm@gmail.com. Sorry!

bmos commented 1 week ago

I'm rebuilding this PR against main, based on our discussion today.

bmos commented 6 days ago

Rebuilt it again to resolve merge conflicts after 3.12 updates. The workflows checks are passing on my fork https://github.com/bmos/parsons/actions/runs/9712736316