Test and check Python code with pytest, Behave, Ruff, mypy, and uv.
1.4K
Test and check Python code with pytest, Behave, Ruff, mypy, and uv.
COPY --from fetches a single binary from a named image without a package managerRUN pip install layer caches installed packages separately from source codeCMD ["bash"] sets an interactive shell as the default container commandThis image contains Python, pip, uv, pytest, Behave, Ruff, and mypy. Use it for course
tasks, local checks, and CI jobs. The base image is python:latest. The working directory is
/workspace. The default command starts Bash.
| Tag | Meaning | Platform |
|---|---|---|
latest | Latest successful build from main. | linux/amd64 |
View all tags on Docker Hub.
The latest tag changes when a new build passes its tests.
docker pull stden/python:latest
Run these commands from your project directory:
docker run --rm -v "$PWD":/workspace stden/python:latest pytest
docker run --rm -v "$PWD":/workspace stden/python:latest behave
docker run --rm -v "$PWD":/workspace stden/python:latest ruff check .
docker run --rm -v "$PWD":/workspace stden/python:latest mypy .
The image does not include your project dependencies. If your project has a requirements file, install them before the tests:
docker run --rm -v "$PWD":/workspace stden/python:latest \
bash -c 'python -m pip install -r requirements.txt && pytest'
For a project with pyproject.toml and uv.lock, uv installs the locked
dependencies in a few seconds:
docker run --rm -v "$PWD":/workspace stden/python:latest \
bash -c 'uv sync --frozen && uv run pytest'
The mount keeps reports and other output in your project directory. Packages that
you install in this container do not stay after the container exits. For repeated
use, install your dependencies in a Dockerfile that starts with
FROM stden/python:latest.
The image smoke test checks Python, uv, pytest, Behave, Ruff, and mypy.
Content type
Image
Digest
sha256:09673d20b…
Size
456.5 MB
Last updated
1 day ago
docker pull stden/python