Skip to content

Conversation

@professorhaseeb
Copy link
Contributor

Description

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

Copy link
Member

@browniebroke browniebroke left a comment

Choose a reason for hiding this comment

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

Why do we need that on CI? AFAIK, the CI worker is only used to run this one installation and then pre-commit creates a venv for each hook so I don't see much benefit here...

Thinking about it, perhaps it would be more beneficial to install pre-commit as tool?

@msamoylov
Copy link
Contributor

Why do we need that on CI? AFAIK, the CI worker is only used to run this one installation and then pre-commit creates a venv for each hook so I don't see much benefit here...

@browniebroke I'm upvoting this one. Actually, the pipeline is failing without that step. See:

$ uv pip install -q pre-commit pre-commit-uv
error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment

@browniebroke
Copy link
Member

Actually, the pipeline is failing without that step. See:

$ uv pip install -q pre-commit pre-commit-uv
error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment

Ok thanks, that's pretty much what I wanted to know 👍🏻

@browniebroke
Copy link
Member

perhaps it would be more beneficial to install pre-commit as tool?

What about this?

before_script:
  - uv tool install pre-commit --with pre-commit-uv
script: 
  - pre-commit run --show-diff-on-failure --color=always --all-files

or just

script: 
  - uv -q tool run --with pre-commit-uv pre-commit run --show-diff-on-failure --color=always --all-files

@browniebroke browniebroke changed the title Add virtual environment setup to GitLab CI Fix virtual environment setup to GitLab CI Jan 7, 2026
@browniebroke browniebroke merged commit 9359750 into cookiecutter:main Jan 7, 2026
15 checks passed
Sephlux pushed a commit to Sephlux/cookiecutter-django-custom that referenced this pull request Jan 8, 2026
Add virtual environment setup to GitLab CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants