Skip to content

Commit 4e8b050

Browse files
committed
fix(deps): replace optional dependencies with dependency groups
Definition: https://packaging.python.org/en/latest/specifications/dependency-groups The optional dependency table ([project.optional-dependencies]) is supposed to be user-facing for installs of TagStudio. Meanwhile, the replacement dependency groups is explicitly meant for extra development tools, so lets use that. This does mean the command for a full development environment has changed from: ```sh pip install -e '.[dev]' ``` To: ```sh pip install -e . --group all ``` The documentation has been adjusted for a quick replacement, but probably should have more information on a later time.
1 parent faf88a9 commit 4e8b050

10 files changed

Lines changed: 33 additions & 22 deletions

File tree

.github/workflows/publish_docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install Python dependencies
3737
run: |
3838
python -m pip install --upgrade uv
39-
uv pip install --system .[mkdocs]
39+
uv pip install --system . --group mkdocs
4040
4141
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
4242

.github/workflows/pyright.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Python dependencies
2323
run: |
2424
python -m pip install --upgrade uv
25-
uv pip install --system .[pyright,pytest]
25+
uv pip install --system . --group pyright --group pytest
2626
2727
- name: Execute Pyright
2828
uses: jordemort/action-pyright@v1

.github/workflows/pytest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
name: Install Python dependencies
2727
run: |
2828
python -m pip install --upgrade uv
29-
uv pip install --system .[pytest]
29+
uv pip install --system . --group pytest
3030
3131
- name: Install system dependencies
3232
run: |

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install Python dependencies
3535
run: |
3636
python -m pip install --upgrade uv
37-
uv pip install --system .[pyinstaller]
37+
uv pip install --system . --group pyinstaller
3838
3939
- name: Execute PyInstaller
4040
run: |
@@ -76,7 +76,7 @@ jobs:
7676
- name: Install Python dependencies
7777
run: |
7878
python -m pip install --upgrade uv
79-
uv pip install --system .[pyinstaller]
79+
uv pip install --system . --group pyinstaller
8080
8181
- name: Execute PyInstaller
8282
run: |
@@ -117,7 +117,7 @@ jobs:
117117
- name: Install Python dependencies
118118
run: |
119119
python -m pip install --upgrade uv
120-
uv pip install --system .[pyinstaller]
120+
uv pip install --system . --group pyinstaller
121121
122122
- name: Execute PyInstaller
123123
run: |

contrib/.envrc-uv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ source "${venv}"/bin/activate
2626

2727
if [ ! -f "${venv}"/pyproject.toml ] || ! diff --brief pyproject.toml "${venv}"/pyproject.toml >/dev/null; then
2828
printf '%s\n' 'Installing dependencies, pyproject.toml changed...' >&2
29-
uv pip install --quiet --editable '.[dev]'
29+
uv pip install --quiet --editable . --group all
3030
cp pyproject.toml "${venv}"/pyproject.toml
3131
fi
3232

docs/developing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ To install the required dependencies, you can use a dependency manager such as [
5757
If using [uv](https://docs.astral.sh/uv), you can install the dependencies for TagStudio with the following command:
5858

5959
```sh
60-
uv pip install -e ".[dev]"
60+
uv pip install -e . --group all
6161
```
6262

6363
TagStudio should now be runnable using the `tagstudio` command.
@@ -109,7 +109,7 @@ If you choose to manually set up a virtual environment and install dependencies
109109
3. Use the following PIP command to create an editable installation and install the required development dependencies:
110110

111111
```sh
112-
pip install -e ".[dev]"
112+
pip install -e . --group all
113113
```
114114

115115
4. TagStudio should now be runnable using the `tagstudio` command.
@@ -161,7 +161,7 @@ The entry point for TagStudio is `src/tagstudio/main.py`. You can target this fi
161161
162162
[Ruff](https://github.com/astral-sh/ruff) is a Python linter and code formatter that helps enforce a consistent formatting style across our codebase.
163163
164-
Ruff is installed alongside the `pip install -e ".[dev]"` command, but is also available as a VS Code [extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff), PyCharm [plugin](https://plugins.jetbrains.com/plugin/20574-ruff), and [more](https://docs.astral.sh/ruff/integrations/).
164+
Ruff is installed alongside the `pip install -e . --group all` command, but is also available as a VS Code [extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff), PyCharm [plugin](https://plugins.jetbrains.com/plugin/20574-ruff), and [more](https://docs.astral.sh/ruff/integrations/).
165165
166166
```sh title="Lint Code"
167167
ruff check
@@ -180,7 +180,7 @@ Ruff should automatically discover the configuration options inside the [pyproje
180180
181181
[Pyright](https://github.com/microsoft/pyright) is a static type checker for Python that helps enforce type strictness and prevent easy-to-miss errors across our codebase.
182182
183-
Pyright is installed alongside the `pip install -e ".[dev]"` command, but is also available as VS Code extensions (see the [Pyright](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright), [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance), and [basedpyright](https://marketplace.visualstudio.com/items?itemName=detachhead.basedpyright) extensions), a PyCharm [setting](https://www.jetbrains.com/help/pycharm/lsp-tools.html#pyright), or in the form of forks such as [basedpyright](https://docs.basedpyright.com/latest/).
183+
Pyright is installed alongside the `pip install -e . --group all` command, but is also available as VS Code extensions (see the [Pyright](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright), [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance), and [basedpyright](https://marketplace.visualstudio.com/items?itemName=detachhead.basedpyright) extensions), a PyCharm [setting](https://www.jetbrains.com/help/pycharm/lsp-tools.html#pyright), or in the form of forks such as [basedpyright](https://docs.basedpyright.com/latest/).
184184
185185
```sh title="Run Checks"
186186
pyright
@@ -192,7 +192,7 @@ Pyright/basedpyright should automatically discover the configuration options ins
192192
193193
[Pytest](https://github.com/pytest-dev/pytest) runs our Python code against the tests inside the [`tests/`](https://github.com/TagStudioDev/TagStudio/tree/main/tests) directory.
194194
195-
Pytest is installed alongside the `pip install -e ".[dev]"` command.
195+
Pytest is installed alongside the `pip install -e . --group all` command.
196196
197197
```sh title="Run Tests"
198198
pytest tests/

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pip install .
5454
!!! note "Developer Dependencies"
5555
If you wish to create an editable install with the additional dependencies required for developing TagStudio, use this modified PIP command instead:
5656
```sh
57-
pip install -e ".[dev]"
57+
pip install -e . --group all
5858
```
5959
_See more under "[Developing](developing.md)"_
6060

flake.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-FileCopyrightText: (c) TagStudio Contributors
22
# SPDX-License-Identifier: GPL-3.0-only
33

4-
54
{
65
description = "TagStudio";
76

nix/shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pkgs.mkShellNoCC {
120120
121121
if [ ! -f "''${venv}"/pyproject.toml ] || ! diff --brief pyproject.toml "''${venv}"/pyproject.toml >/dev/null; then
122122
printf '%s\n' 'Installing dependencies, pyproject.toml changed...' >&2
123-
uv pip install --quiet --editable '.[mkdocs,mypy,pre-commit,pytest]'
123+
uv pip install --quiet --editable . --group docs --group extra --group test
124124
cp pyproject.toml "''${venv}"/pyproject.toml
125125
fi
126126

pyproject.toml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,28 @@ dependencies = [
4242
"semver~=3.0.4",
4343
]
4444

45-
[project.optional-dependencies]
46-
dev = ["tagstudio[mkdocs,pyright,pre-commit,pyinstaller,pytest,ruff]"]
45+
[project.gui-scripts]
46+
tagstudio = "tagstudio.main:main"
47+
48+
[dependency-groups]
49+
all = [
50+
{ include-group = "check" },
51+
{ include-group = "build" },
52+
{ include-group = "docs" },
53+
{ include-group = "extra" },
54+
]
55+
check = [{ include-group = "lint" }, { include-group = "test" }]
56+
57+
build = [{ include-group = "pyinstaller" }]
58+
docs = [{ include-group = "mkdocs" }]
59+
extra = [{ include-group = "pre-commit" }]
60+
lint = [{ include-group = "pyright" }, { include-group = "ruff" }]
61+
test = [{ include-group = "pytest" }]
62+
4763
mkdocs = ["mkdocs-material[imaging]>=9.7", "mkdocs-redirects~=1.2"]
48-
pyright = ["pyright~=1.1.409"]
4964
pre-commit = ["pre-commit~=4.2"]
5065
pyinstaller = ["Pyinstaller~=6.21"]
66+
pyright = ["pyright~=1.1.409"]
5167
pytest = [
5268
"pytest==9.0.3",
5369
"pytest-cov==6.1.1",
@@ -57,13 +73,9 @@ pytest = [
5773
]
5874
ruff = ["ruff==0.15.17"]
5975

60-
[project.gui-scripts]
61-
tagstudio = "tagstudio.main:main"
62-
6376
[tool.hatch.build.targets.wheel]
6477
packages = ["src/tagstudio"]
6578

66-
6779
[tool.pytest.ini_options]
6880
qt_api = "pyside6"
6981
pythonpath = ["src"]

0 commit comments

Comments
 (0)