🇨🇳 中文
Standard Python Environment
🇺🇸 English | 🇮🇳 हिंदी | 🇯🇵 日本語 | 🇨🇳 简体中文 | 🇪🇸 Español | 🇧🇷 Português (Brasil) | 🇰🇷 한국어 | 🇩🇪 Deutsch | 🇫🇷 Français
一个使用 Docker Compose 构建的标准 Python 环境。

功能特性
- 可复现性:依赖项锁定在容器内部
- 简单性:只需使用 docker compose 命令即可运行
- 可移植性:可在 Linux、macOS 和 Windows 上运行
- pip ready:轻松安装和管理 Python 包
- JupyterLab support:(可选)在容器内运行 notebooks
- X11 forwarding:(可选)运行基于 GUI 的 Python 应用
要求
快速开始
Linux
# Clone this repository
git clone https://github.com/europanite/standard_python_environment.git
cd standard_python_environment
# Export host UID/GID
export HOST_UID=$(id -u)
export HOST_GID=$(id -g)
# Build and run
docker compose build
docker compose up -d
docker compose exec service bash
Windows
# Clone this repository
git clone https://github.com/europanite/standard_python_environment.git
cd standard_python_environment
# Build and run
docker compose build
docker compose up -d
docker compose exec service bash
现在你已经进入 Python 容器了 🎉
如果使用 JupyterLab,只需访问 http://localhost:8888
测试
# pytest
docker compose \
-f docker-compose.test.yml run \
--rm \
--entrypoint /bin/sh service_test \
-lc 'pytest'
# Lint
docker compose \
-f docker-compose.test.yml run \
--rm \
--entrypoint /bin/sh service_test \
-lc 'ruff check /app /tests'
许可证
- Apache License 2.0