File tree Expand file tree Collapse file tree 6 files changed +22
-13
lines changed
Expand file tree Collapse file tree 6 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 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
1117COPY --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
1620RUN --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"
Original file line number Diff line number Diff line change 1+ # Exclude the project virtual environment from image builds
2+ .venv
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ dynamic = ["version"]
3333[project .scripts ]
3434python_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" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ pushd "${REPO_ROOT}" 2>&1 > /dev/null
88echo " Building documentation..."
99mkdir -p build
1010cd docs
11- uv run --all-extras make html
11+ make html
1212
1313popd 2>&1 > /dev/null
Original file line number Diff line number Diff line change @@ -11,31 +11,31 @@ STATUS=0
1111set +e
1212
1313echo " 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
1515if [ $? -ne 0 ]; then
1616 STATUS=1
1717fi
1818
1919echo " Running mypy..."
20- uv run --all-extras mypy src/python_training_project > build/mypy.txt
20+ mypy src/python_training_project > build/mypy.txt
2121if [ $? -ne 0 ]; then
2222 STATUS=1
2323fi
2424
2525echo " 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
2727if [ $? -ne 0 ]; then
2828 STATUS=1
2929fi
3030
3131echo " Running ruff check..."
32- uv run --all-extras ruff check > build/ruff.txt
32+ ruff check > build/ruff.txt
3333if [ $? -ne 0 ]; then
3434 STATUS=1
3535fi
3636
3737echo " Running ruff format..."
38- uv run --all-extras ruff format --check
38+ ruff format --check
3939if [ $? -ne 0 ]; then
4040 STATUS=1
4141fi
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ pushd "${REPO_ROOT}" 2>&1 > /dev/null
88mkdir -p build
99
1010echo " Running tests..."
11- uv run --all-extras pytest
11+ pytest
1212
1313popd 2>&1 > /dev/null
You can’t perform that action at this time.
0 commit comments