Skip to content
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

build: Use uv over Poetry #60

Closed
wants to merge 2 commits into from
Closed

build: Use uv over Poetry #60

wants to merge 2 commits into from

Conversation

jesse-c
Copy link
Contributor

@jesse-c jesse-c commented Oct 17, 2024

why:

Honestly, it's mostly for speed, and newness. We're relatively simple users of Python project/package tooling.

pros:

Dependencies installation is 150% faster (from 1.5mins → ~30secs), overall CI time is 100% faster (from ~3mins20secs [6] → ~1.5mins [7][8]) the pyproject.toml is slightly more adhering to the PEP standard, can consolidate tools like pipx, and can install Python versions/environments.

cons:

Dependabot support is coming [1][2][3]. People are less familiar with uv. Requires installing uv.

testing:

I've tested it on a side-project for building and running a Docker image in Railway [4].

how:

This follows official recommendations [5] for CI/CD setup.

appendix:

[1] dependabot/dependabot-core#10040
[2] dependabot/dependabot-core#10039
[3] astral-sh/uv#2512
[4] https://github.com/jesse-c/instagram-image-already-posted-check/blob/87f4027f4262580fb327a685a34ddfcbab005a90/service/Dockerfile
[5] https://docs.astral.sh/uv/guides/integration/github/
[6] https://github.com/climatepolicyradar/knowledge-graph/actions/runs/11386004236/job/31677168819
[7] https://github.com/climatepolicyradar/knowledge-graph/actions/runs/11394946487/job/31706241571?pr=60
[8] https://github.com/climatepolicyradar/knowledge-graph/actions/runs/11394946487/job/31706241398?pr=60

@jesse-c jesse-c force-pushed the use-uv branch 7 times, most recently from 95e0b44 to 9af186a Compare October 18, 2024 00:02
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explanation: Once less place to maintain the version, as setup-python supports pyproject.yaml.

@jesse-c jesse-c marked this pull request as ready for review October 18, 2024 00:15
@jesse-c jesse-c requested review from a team as code owners October 18, 2024 00:15
@kdutia
Copy link
Member

kdutia commented Oct 21, 2024

are these changes to the pyproject.toml still compatible with poetry?

@jesse-c
Copy link
Contributor Author

jesse-c commented Oct 21, 2024

are these changes to the pyproject.toml still compatible with poetry?

@kdutia: They are not!

@kdutia
Copy link
Member

kdutia commented Oct 21, 2024

@jesse-c so then to add to cons - everyone working with this repo needs to install uv and presumably an extra python installation and learn its syntax? (maybe not a big con, but a chore for team members)

happy to follow platform team consensus on this but the cost/benefit doesn't seem clear to me!

@jesse-c
Copy link
Contributor Author

jesse-c commented Oct 21, 2024

@kdutia: Good point! I've added that to the list. It uses existing Python installations, though it can also manages its own, if desired.

@olaughter
Copy link
Contributor

cons - everyone working with this repo needs to install uv and presumably an extra python installation and learn its syntax

Similar to this con, having inconsistency across repos adds to cognitive load over time. So I don't think we really would want to add it to one place unless we where treating it as a trial before rolling it out more widely (And I don't think we should do that without dependabot support and without checking for wider buy-in more explicitly)

@olaughter
Copy link
Contributor

I do really like the simplicity and speed increases though! Perhaps we can revisit after dependabot support is in?

@jesse-c
Copy link
Contributor Author

jesse-c commented Oct 22, 2024

That's very reasonable! 🙇🏻

@jesse-c jesse-c closed this Oct 22, 2024
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.

3 participants