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

chore: use UV as package manager #245

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jorgenengelsen
Copy link
Contributor

@jorgenengelsen jorgenengelsen commented Aug 23, 2024

Why is this pull request needed?

This pull request is mainly for testing out UV as an alternative for poetry

What does this pull request change?

Replace poetry with UV

Makes the CI slightly faster, and setting up a new python environment much faster.

without uv and cache:
Screenshot 2024-08-23 at 12 54 42

uv with cache:
Screenshot 2024-08-23 at 12 52 05

Issues related to this change:

@jorgenengelsen jorgenengelsen force-pushed the chore/replace-poetry-with-uv branch 15 times, most recently from b2d016f to cc0dbad Compare August 23, 2024 10:40
api/Dockerfile Outdated
COPY uv.lock uv.lock

RUN mkdir -p /.cache/uv && \
chown -R 1000:1000 /.cache/uv/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if this is best practice, but uv needs read/write access to this folder. (even with --no-cache)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can undo this chown after running "uv sync". At least in the prod image

pre-commit = ">=3"
pytest = "^7.2.2"
mongomock = "^4.1.2"
requires-python = ">=3.10"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
requires-python = ">=3.10"
requires-python = ">=3.10"

Should probably refine this, docker uses 3.11 now, while locally/pre-commit using uv will select latest supported python version -> 3.12

@jorgenengelsen jorgenengelsen self-assigned this Aug 23, 2024
@jorgenengelsen jorgenengelsen changed the title chore: use UV for as package manager chore: use UV as package manager Aug 23, 2024
@jorgenengelsen jorgenengelsen marked this pull request as ready for review August 23, 2024 11:23
@jorgenengelsen jorgenengelsen requested a review from a team as a code owner August 23, 2024 11:23
@jorgenengelsen jorgenengelsen force-pushed the chore/replace-poetry-with-uv branch 2 times, most recently from 825f615 to bc7b039 Compare August 23, 2024 11:25
Copy link
Collaborator

@soofstad soofstad left a comment

Choose a reason for hiding this comment

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

Let's try it!
How is Snyk support? 😛

@jorgenengelsen
Copy link
Contributor Author

Let's try it! How is Snyk support? 😛

Heh! Good question. I have lost access to the Snyk team. UV follows the standard specification for dependencies in pyproject.toml (https://packaging.python.org/en/latest/specifications/pyproject-toml/), but Poetry has its own syntax. Knowing snyk I am betting they don't support it..

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