Skip to content

Commit 45f2d73

Browse files
simonwclaude
andauthored
Switch to uv and dependency-groups (#11)
- Replace [project.optional-dependencies] with [dependency-groups] in pyproject.toml - Remove [tool.uv] section - Update GitHub Actions workflows to use pip install . --group dev - Simplify README development instructions to use uv run pytest - Add uv.lock to .gitignore See https://til.simonwillison.net/uv/dependency-groups Co-authored-by: Claude <[email protected]>
1 parent 03450dc commit 45f2d73

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,8 @@ Having created the new structure from the template, here's how to start working
3939
If your library is called `my-new-library`, you can start working on it like so:
4040
```bash
4141
cd my-new-library
42-
# Create and activate a virtual environment:
43-
python -m venv venv
44-
source venv/bin/activate
45-
# Install dependencies so you can edit the project:
46-
python -m pip install -e '.[test]'
47-
# With zsh you have to run this again for some reason:
48-
source venv/bin/activate
49-
```
50-
You can run the default test for your library like so:
51-
```bash
52-
python -m pytest
42+
# Run the tests
43+
uv run pytest
5344
```
5445
This will execute the test in `tests/test_my_new_library.py`.
5546

{{cookiecutter.hyphenated}}/.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
cache-dependency-path: pyproject.toml
2424
- name: Install dependencies
2525
run: |
26-
pip install '.[test]'
26+
pip install . --group dev
2727
- name: Run tests
2828
run: |
2929
python -m pytest

{{cookiecutter.hyphenated}}/.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cache-dependency-path: pyproject.toml
2222
- name: Install dependencies
2323
run: |
24-
pip install '.[test]'
24+
pip install . --group dev
2525
- name: Run tests
2626
run: |
2727
python -m pytest

{{cookiecutter.hyphenated}}/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ venv
99
.DS_Store
1010
dist
1111
build
12+
uv.lock

{{cookiecutter.hyphenated}}/pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ dependencies = [
1111

1212
]
1313

14+
[dependency-groups]
15+
dev = [
16+
"pytest"
17+
]
18+
1419
[build-system]
1520
requires = ["setuptools"]
1621
build-backend = "setuptools.build_meta"
1722

18-
[tool.uv]
19-
package = true
2023
{% if cookiecutter.github_username %}
2124
[project.urls]
2225
Homepage = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.hyphenated }}"
2326
Changelog = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.hyphenated }}/releases"
2427
Issues = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.hyphenated }}/issues"
2528
CI = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.hyphenated }}/actions"
2629
{% endif %}
27-
28-
[project.optional-dependencies]
29-
test = ["pytest"]

0 commit comments

Comments
 (0)