This directory contains the GitHub Codespaces configuration for ScanAPI.
Main Dev Container configuration file. Defines:
- Base image: Python 3.12 (Bullseye)
- Features: Git and GitHub CLI
- VS Code Extensions: Python, Pylance, Ruff, MyPy, GitLens, etc.
- Editor settings: Auto-formatting, ruff linting, pytest
- Ports: 8000 (server) and 9000 (documentation)
- Post-creation script:
post-create.sh
Script automatically executed after the container is created:
- Updates system packages
- Installs
uv(fast package manager) - Installs project dependencies with
uv pip install -e ".[dev]" - Configures pre-commit hooks
- Runs initial verification checks
Defines the container image:
- Base:
python:1-3.12-bullseye - Installs additional tools: git, curl, build-essential, zsh
- Installs
uvfor package management - Sets Python environment variables
Script to validate the configuration:
bash .devcontainer/validate.sh# Via GitHub
1. Go to the repository
2. Code → Codespaces → Create codespace on main
3. Wait 2-3 minutes
# Via CLI (if gh is installed)
gh codespace create -b main -R scanapi/scanapi# VS Code: Cmd+Shift+P
# Type: "Dev Containers: Reopen in Container"The ScanAPI examples repository is automatically cloned during container setup at /workspaces/examples.
This gives you immediate access to test examples:
# Your workspace after setup:
/workspaces/
├── scanapi/ # Main project
└── examples/ # Auto-cloned examples
├── pokeapi/
├── demo-api/
└── ...
# Test examples:
uv run scanapi run ../examples/pokeapi/scanapi.yaml -c ../examples/pokeapi/scanapi.conf -o ../examples/pokeapi/scanapi-report.htmlNo need for manual setup—everything is ready to test!
Python 3.12
├── Runtime
│ ├── appdirs, curlify2, rich, PyYAML, Jinja2, click
│ ├── httpx, packaging, restrictedpython
│ └── MarkupSafe (pinned: 3.0.3)
└── Development
├── Testing: pytest, pytest-cov, pytest-freezegun, pytest-mock
├── Linting: ruff, pre-commit
├── Type checking: mypy, types-*
├── Documentation: sphinx, sphinx_rtd_theme
└── Security: bandit, requests-mock
In devcontainer.json, modify the section:
"extensions": [
"publisher.extension-id",
// ... add more
]In pyproject.toml:
dev = [
# ... add here
"new-dependency>=1.0"
]Edit post-create.sh to add custom commands.
If you need environment variables, add them in devcontainer.json:
"remoteEnv": {
"VARIABLE_NAME": "value"
}# Inside the container, verify:
python --version # Python 3.12
uv --version # uv package manager
which ruff # Should return path
which mypy # Should return path
which pytest # Should return pathIssue: Container won't start
- Recreate: Click remote button → "Rebuild Container"
Issue: Dependencies not found
- Reinstall:
uv pip install -e ".[dev]" --force-reinstall
Issue: .devcontainer ignored in Codespaces
- Commit and push: Git add → commit → push
- Create new codespace (don't use old ones)
For complete documentation, see Run ScanAPI in Dev Env