Skip to content

Update uv#557

Open
Sahil Raja (Sahil590) wants to merge 23 commits into
mainfrom
update-uv
Open

Update uv#557
Sahil Raja (Sahil590) wants to merge 23 commits into
mainfrom
update-uv

Conversation

@Sahil590

@Sahil590 Sahil Raja (Sahil590) commented May 20, 2026

Copy link
Copy Markdown

Description

I have removed all the refs to poetry and pip-tools in the template and this repo.

Close #507

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request migrates the template repository to an uv-only packaging workflow, removing Poetry and pip-tools support and updating the cookiecutter hook + CI to match.

Changes:

  • Add uv project metadata and lockfile for the template repository (pyproject.toml, uv.lock).
  • Remove Poetry/pip-tools-specific template files, requirements files, and workflows; update documentation to reflect uv-only support.
  • Update the cookiecutter post-generation hook to add dependencies via uv, and replace related unit tests.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
uv.lock Adds an uv lockfile for reproducible dependency resolution in the template repo.
pyproject.toml Defines the template repo as an uv-managed (non-packaged) project with dev dependency groups.
README.md Updates top-level documentation to uv-only and removes Poetry/pip-tools references.
hooks/post_gen_project.py Switches post-generation dependency setup to uv add and simplifies packaging branching.
tests/test_pyproject_patching.py Replaces prior pyproject patching tests with tests for the new uv hook behaviour.
cookiecutter.json Fixes packaging to "uv" (no longer a multi-option choice).
dev-requirements.txt Removes pip-based dev requirements file from the template repo.
{{ cookiecutter.project_slug }}/pyproject.toml Removes multi-packager templating branches, leaving the uv path.
{{ cookiecutter.project_slug }}/.github/workflows/ci.yml Removes Poetry/pip-tools branches and keeps uv-only CI steps.
{{ cookiecutter.project_slug }}/.github/workflows/docs.yml Removes non-uv branches; docs build uses uv-only installation.
.github/workflows/ci-uv.yml Updates template-repo CI to install deps via uv sync instead of pip requirements.
.github/workflows/ci-poetry.yml Removes Poetry CI workflow.
.github/workflows/ci-pip-tools.yml Removes pip-tools CI workflow.
{{ cookiecutter.project_slug }}/README.poetry.jinja Removes Poetry-specific generated project README fragment.
{{ cookiecutter.project_slug }}/README.pip-tools.jinja Removes pip-tools-specific generated project README fragment.
{{ cookiecutter.project_slug }}/requirements.txt Removes pip-tools autogenerated requirements artefact from the template.
{{ cookiecutter.project_slug }}/dev-requirements.txt Removes pip-tools autogenerated dev requirements artefact from the template.
{{ cookiecutter.project_slug }}/doc-requirements.txt Removes pip-tools autogenerated doc requirements artefact from the template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread .github/workflows/ci-uv.yml Outdated
Comment thread hooks/post_gen_project.py
Comment thread tests/test_pyproject_patching.py
Copilot AI review requested due to automatic review settings May 20, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Comment thread .github/workflows/ci-uv.yml Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread hooks/post_gen_project.py
Comment thread cookiecutter.json
Sahil Raja (Sahil590) and others added 2 commits May 20, 2026 15:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 20, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Comment thread README.md Outdated
Comment thread cookiecutter.json
Comment thread hooks/post_gen_project.py
Comment on lines +44 to +48
def add_uv_dependencies():
subprocess.run(["git", "init"], check=True)
subprocess.run(["uv", "add", "--dev", *DEV_DEPS], check=True)
if MKDOCS_ENABLED:
subprocess.run(["uv", "add", "--group", "doc", *DOC_DEPS], check=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the git init necessary or can we get away without it Sahil Raja (@Sahil590)? We decided against doing this previously: #17

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Its needed for the setuptools-scm it fails when it cannot detect a git repo.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah yes, that is annoying. We have been talking about maybe getting rid of setuptools-scm for this reason (or making it configurable; #526). We were planning on talking about it at the next tech forum.

Does setuptools-scm work even if your git repo doesn't have any commits in it?

I suppose if it's going to be a requirement for users to have git on their PATH to use this template, we should probably document this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PS - I guess if we are going to initialise git for the repo, then we could also install the pre-commit hooks while we're at it. Just a thought. Maybe better to open an issue for that one

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah yes, that is annoying. We have been talking about maybe getting rid of setuptools-scm for this reason (or making it configurable; #526). We were planning on talking about it at the next tech forum.

Does setuptools-scm work even if your git repo doesn't have any commits in it?

I suppose if it's going to be a requirement for users to have git on their PATH to use this template, we should probably document this.

I guess then we can leave this until we discuss the setuptools-scm in the forum meeting.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, I think this is ok for now. I don't think we should wait until we've figured out the setuptools-scm thing before merging this PR though, as that should probably be done separately anyway.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ok will address the rest of the comments then should be ready

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd definitely rather not have git init run automatically. Which part failed because of setuptools-scm was it the uv add steps?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. I've tested it and it works fine. Just a couple of minor comments.

Comment thread .github/workflows/ci-uv.yml Outdated
Comment thread cookiecutter.json Outdated

@alexdewar Alex Dewar (alexdewar) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is great. Thank you!

There are a few small tweaks needed, but it's mostly there.

Comment thread .github/workflows/ci-uv.yml Outdated
Comment thread .github/workflows/ci-uv.yml Outdated
Comment thread hooks/post_gen_project.py
Comment on lines +44 to +48
def add_uv_dependencies():
subprocess.run(["git", "init"], check=True)
subprocess.run(["uv", "add", "--dev", *DEV_DEPS], check=True)
if MKDOCS_ENABLED:
subprocess.run(["uv", "add", "--group", "doc", *DOC_DEPS], check=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the git init necessary or can we get away without it Sahil Raja (@Sahil590)? We decided against doing this previously: #17

Comment thread {{ cookiecutter.project_slug }}/README.poetry.jinja Outdated
Comment thread hooks/post_gen_project.py Outdated
Comment thread hooks/post_gen_project.py Outdated
Comment thread pyproject.toml
Comment thread README.md
Comment thread README.md Outdated
Co-authored-by: Alex Dewar <alexdewar@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Comment thread README.md Outdated
Comment thread tests/test_pyproject_patching.py Outdated
def test_check_uv_installed_success(monkeypatch):
with patch("hooks.post_gen_project.subprocess.run") as mock_run:
post_gen_project.check_uv_installed()
mock_run.assert_called_once_with(["uv", "--version"], check=True, stdout=-3)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree

Comment thread hooks/post_gen_project.py
Comment on lines +55 to +59
def add_uv_dependencies():
subprocess.run(["git", "init"], check=True)
subprocess.run(["uv", "add", "--dev", *DEV_DEPS], check=True)
if MKDOCS_ENABLED:
subprocess.run(["uv", "add", "--group", "doc", *DOC_DEPS], check=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is one reason not to unconditionally run git init on a new repo, but admittedly not a strong one 😛

@alexdewar Alex Dewar (alexdewar) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is there except for the failing tests. There are just a few markdownlint issues in the readme file.


```bash
git init
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Markdownlint is complaining about a few of these code blocks, which is why the CI is failing. Maybe it's the extra level of indentation that's causing the issue?

Testing this is currently a bit annoying: you have to generate a new project, then initialise pre-commit and run the hooks.

markdownlint-fix.........................................................Failed
- hook id: markdownlint-fix
- exit code: 1
- files were modified by this hook

README.md:29 MD046/code-block-style Code block style [Expected: indented; Actual: fenced]
README.md:49 MD046/code-block-style Code block style [Expected: indented; Actual: fenced]
README.md:55 MD046/code-block-style Code block style [Expected: indented; Actual: fenced]
README.md:61 MD046/code-block-style Code block style [Expected: indented; Actual: fenced]
README.md:67 MD046/code-block-style Code block style [Expected: indented; Actual: fenced]
README.md:73 MD046/code-block-style Code block style [Expected: indented; Actual: fenced]

Comment thread hooks/post_gen_project.py
Comment on lines +44 to +48
def add_uv_dependencies():
subprocess.run(["git", "init"], check=True)
subprocess.run(["uv", "add", "--dev", *DEV_DEPS], check=True)
if MKDOCS_ENABLED:
subprocess.run(["uv", "add", "--group", "doc", *DOC_DEPS], check=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PS - I guess if we are going to initialise git for the repo, then we could also install the pre-commit hooks while we're at it. Just a thought. Maybe better to open an issue for that one

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.

Drop packaging options other than uv

5 participants