Skip to content

Commit d9d8467

Browse files
committed
Refactor dependency management to use pip dependency groups
Updated `pyproject.toml` to utilize pip's `--group` feature for dependencies. Adjusted the README and Dockerfile to reflect the new dependency management approach.
1 parent f362130 commit d9d8467

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ Please report issues at https://tickets.musicbrainz.org/browse/BU.
99

1010
# Development
1111
To develop BrainzUtils itself, install it locally in editable mode with development
12-
dependencies by running: `pip install -e '.[dev]'`.
12+
dependencies by running: `pip install --group dev -e .`.
13+
14+
> [!NOTE]
15+
> Support for dependency groups (`--group`) was added to pip in 25.1.0.
1316
1417
## Usage
1518

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ dependencies = [
2121
"mbdata@git+https://github.com/metabrainz/mbdata.git@v30.0.0"
2222
]
2323

24-
[project.optional-dependencies]
24+
[dependency-groups]
2525
dev = [
2626
"psycopg2-binary==2.9.10",
27+
]
28+
test = [
2729
"freezegun==1.5.1",
2830
"pytest==8.3.5",
2931
"pytest-cov==6.1.1",
30-
"pylint==3.3.6"
32+
"pylint==3.3.6",
33+
{ include-group = "dev" }
3134
]
3235

3336
[tool.setuptools]

test/Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,10 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
77
RUN mkdir /code
88
WORKDIR /code
99

10-
# Python dependencies
11-
RUN apt-get update \
12-
&& apt-get install -y --no-install-recommends \
13-
build-essential \
14-
git
10+
RUN pip install --upgrade pip==25.1.1
1511

16-
COPY requirements.txt /code/requirements.txt
17-
COPY requirements_dev.txt /code/requirements_dev.txt
18-
RUN pip install -r requirements.txt
19-
RUN pip install -r requirements_dev.txt
12+
COPY pyproject.toml /code/pyproject.toml
13+
RUN pip install --group test .
2014

2115
COPY . /code/
2216

0 commit comments

Comments
 (0)