cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

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

Open Andrew-Chen-Wang opened this issue 1 year ago • 4 comments

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 avatar Mar 09 '24 22:03 Andrew-Chen-Wang

Is uv marked as stable?

luzfcb avatar Mar 09 '24 22:03 luzfcb

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.

Andrew-Chen-Wang avatar Mar 10 '24 02:03 Andrew-Chen-Wang

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?

foarsitter avatar Mar 11 '24 15:03 foarsitter

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

Andrew-Chen-Wang avatar Mar 11 '24 20:03 Andrew-Chen-Wang