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

Use Astral's uv for pip installation in Docker + CI #4915

Open
Andrew-Chen-Wang opened this issue Mar 9, 2024 · 4 comments
Open

Use Astral's uv for pip installation in Docker + CI #4915

Andrew-Chen-Wang opened this issue Mar 9, 2024 · 4 comments

Comments

@Andrew-Chen-Wang
Copy link
Contributor

Andrew-Chen-Wang commented Mar 9, 2024

Description

Use uv to pip install requirements in Docker and CI

Rationale

Haven't seen something resolve and install as quickly as uv before. At my firm, we saw 80% performance gains replacing poetry. For cookiecutter-django, uv pip install -r requirements/local.txt installed in ~2 seconds.

@Andrew-Chen-Wang Andrew-Chen-Wang changed the title Use Astral's uv for pip installation in Docker Use Astral's uv for pip installation in Docker + CI Mar 9, 2024
@luzfcb
Copy link
Collaborator

luzfcb commented Mar 9, 2024

Is uv marked as stable?

@Andrew-Chen-Wang
Copy link
Contributor Author

Still marked in beta, but cookiecutter-django doesn't use any advanced features like local package URLs. It's fairly stable from the resolution (like poetry resolution) and pip installation of packages. Haven't noticed any packages any issues. Also, I ran the packages here and didn't have any problems installing local packages.

@foarsitter
Copy link
Collaborator

foarsitter commented Mar 11, 2024

We need an abstraction layer for the packagemanager. I did some experimenting with a custom extension. This way we can implement poetry and uv alongside pip.

jobs:
  include:
    - name: "Linter"
      before_script:
        - {{ "ruff"|install(cookiecutter)}}

What do you think?

@Andrew-Chen-Wang
Copy link
Contributor Author

Andrew-Chen-Wang commented Mar 11, 2024

Sounds right. I can help make the abstraction since I think uv compiling a lock file will be useful like poetry lock. I do think that the lock file would have to generated as a post gen hook

But if you mean abstracting as custom Python scripts, I'd disagree. I think we'd want to let users use the package managing tools' CLI directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants