Skip to content

Commit 1b7bb4c

Browse files
committed
Migrate from dev-dependencies to dependency-groups
1 parent 327b86b commit 1b7bb4c

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# https://github.com/devcontainers/images/tree/main/src/python
2-
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm
2+
FROM mcr.microsoft.com/devcontainers/python:1-3.13-bookworm
33

44
# Install additional packages.
55
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
66
# && apt-get -y install --no-install-recommends \
77
# <your-package-list-here> \
88
# && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
99

10+
# Install the project into `/app`
11+
WORKDIR /app
12+
13+
# Enable bytecode compilation
14+
ENV UV_COMPILE_BYTECODE=1
15+
1016
# Install UV / UVX
1117
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
12-
ENV UV_COMPILE_BYTECODE=1
13-
ENV UV_LINK_MODE=copy
1418

1519
# Install project dependencies
1620
RUN --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
1721
--mount=type=bind,source=uv.lock,target=uv.lock \
18-
uv sync --frozen --no-install-project --all-extras
22+
uv sync --frozen --no-install-project --all-groups
23+
24+
# Place executables in the environment at the front of the path
25+
ENV PATH="/app/.venv/bin:$PATH"

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Exclude the project virtual environment from image builds
2+
.venv

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ dynamic = ["version"]
3333
[project.scripts]
3434
python_training_project = "python_training_project.__main__:cli"
3535

36-
[tool.uv]
37-
dev-dependencies = [
36+
[dependency-groups]
37+
dev = [
3838
"coverage",
3939
"flake8",
4040
"mypy",

tools/build-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ pushd "${REPO_ROOT}" 2>&1 > /dev/null
88
echo "Building documentation..."
99
mkdir -p build
1010
cd docs
11-
uv run --all-extras make html
11+
make html
1212

1313
popd 2>&1 > /dev/null

tools/lint-package.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@ STATUS=0
1111
set +e
1212

1313
echo "Running flake8..."
14-
uv run --all-extras flake8 src/python_training_project --format=pylint > build/flake8.txt
14+
flake8 src/python_training_project --format=pylint > build/flake8.txt
1515
if [ $? -ne 0 ]; then
1616
STATUS=1
1717
fi
1818

1919
echo "Running mypy..."
20-
uv run --all-extras mypy src/python_training_project > build/mypy.txt
20+
mypy src/python_training_project > build/mypy.txt
2121
if [ $? -ne 0 ]; then
2222
STATUS=1
2323
fi
2424

2525
echo "Running pylint..."
26-
uv run --all-extras pylint src/python_training_project --msg-template="{path}:{line}: [{msg_id}, {obj}] {msg} ({symbol})" > build/pylint.txt
26+
pylint src/python_training_project --msg-template="{path}:{line}: [{msg_id}, {obj}] {msg} ({symbol})" > build/pylint.txt
2727
if [ $? -ne 0 ]; then
2828
STATUS=1
2929
fi
3030

3131
echo "Running ruff check..."
32-
uv run --all-extras ruff check > build/ruff.txt
32+
ruff check > build/ruff.txt
3333
if [ $? -ne 0 ]; then
3434
STATUS=1
3535
fi
3636

3737
echo "Running ruff format..."
38-
uv run --all-extras ruff format --check
38+
ruff format --check
3939
if [ $? -ne 0 ]; then
4040
STATUS=1
4141
fi

tools/test-package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ pushd "${REPO_ROOT}" 2>&1 > /dev/null
88
mkdir -p build
99

1010
echo "Running tests..."
11-
uv run --all-extras pytest
11+
pytest
1212

1313
popd 2>&1 > /dev/null

0 commit comments

Comments
 (0)