Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ cd example-research-software-project
git init
# uv venv
# source .venv/bin/activate
uv pip install -e ".[dev]"
uv pip install -e . --group dev
```

Note that `uv>=0.6.7` is required to use the `--group` option.

<!-- links here -->

<!-- prettier-ignore-start -->
Expand Down
42 changes: 23 additions & 19 deletions tests/data/test_package_generation/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ requires = [
"setuptools-scm",
]

[dependency-groups]
dev = [
"build",
"mypy",
"pre-commit",
"ruff",
"tox",
"twine",
]
docs = [
"mkdocs",
"mkdocs-include-markdown-plugin",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
]
test = [
"pytest",
"pytest-cov",
]

[project]
authors = [
{email = "eva.lu.ator@ucl.ac.uk", name = "Eva Lu Ator"},
Expand All @@ -31,23 +52,6 @@ license-files = [
"LICENSE.md",
]
name = "cookiecutter-test"
optional-dependencies = {dev = [
"build",
"mypy",
"pre-commit",
"ruff",
"tox",
"twine",
], docs = [
"mkdocs",
"mkdocs-include-markdown-plugin",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
], test = [
"pytest",
"pytest-cov",
]}
readme = "README.md"
requires-python = ">=3.11"
urls.homepage = "https://github.com/test-user/cookiecutter-test"
Expand Down Expand Up @@ -126,7 +130,7 @@ env_run_base = {commands = [
"--cov",
"--cov-report=xml",
],
], extras = [
], dependency_groups = [
"test",
]}
env.docs = {commands = [
Expand All @@ -135,7 +139,7 @@ env.docs = {commands = [
"build",
"--strict",
],
], extras = [
], dependency_groups = [
"docs",
]}
gh.python."3.11" = ["py311"]
Expand Down
6 changes: 3 additions & 3 deletions tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ uv venv --python 3.11.6
Once you have created and activated a virtual environment for the project, you can install the package in [editable mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html), along with both its required dependencies and optional sets of dependencies for development (`dev`), documentation (`docs`) and testing (`test`) by running

```sh
uv pip install --editable ".[dev,docs,test]"
uv pip install --editable . --group dev --group docs --group test
```

from the root of the project repository.
from the root of the project repository. Note that `uv>=0.6.7` is required to use the `--group` option.

<details><summary>Using venv as an alternative to uv </summary> <!-- markdownlint-disable-line MD033 -->

Expand Down Expand Up @@ -343,7 +343,7 @@ python -m pip install --upgrade pip
Similar to `uv`, once the environment is active, you can install the package in editable mode as well as all dependencies:

```sh
python -m pip install --editable ".[dev,docs,test]"
python -m pip install --editable . --group dev --group docs --group test
```

</details>
Expand Down
42 changes: 23 additions & 19 deletions {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ requires = [
"setuptools-scm",
]

[dependency-groups]
dev = [
"build",
"mypy",
"pre-commit",
"ruff",
"tox",
"twine",
]
docs = [
"mkdocs",
"mkdocs-include-markdown-plugin",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
]
test = [
"pytest",
"pytest-cov",
]

[project]
authors = [
{email = "{{cookiecutter.author_email}}", name = "{{cookiecutter.author_given_names}} {{cookiecutter.author_family_names}}"},
Expand Down Expand Up @@ -34,23 +55,6 @@ license-files = [
"LICENSE.md",
]
name = "{{cookiecutter.project_slug}}"
optional-dependencies = {dev = [
"build",
"mypy",
"pre-commit",
"ruff",
"tox",
"twine",
], docs = [
"mkdocs",
"mkdocs-include-markdown-plugin",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
], test = [
"pytest",
"pytest-cov",
]}
readme = "README.md"
requires-python = ">={{cookiecutter.min_python_version}}"
urls.homepage = "{{cookiecutter.__repo_url}}"
Expand Down Expand Up @@ -132,7 +136,7 @@ env_run_base = {commands = [
"--cov",
"--cov-report=xml",
],
], extras = [
], dependency_groups = [
"test",
]}
env.docs = {commands = [
Expand All @@ -141,7 +145,7 @@ env.docs = {commands = [
"build",
"--strict",
],
], extras = [
], dependency_groups = [
"docs",
]}
{%- for python_version in range(
Expand Down
Loading