Merge pull request #881 from MemPalace/feat/devcontainer
feat: add VSCode devcontainer matching CI environment
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "MemPalace",
|
||||
"image": "mcr.microsoft.com/devcontainers/python:3.11",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"ms-python.debugpy",
|
||||
"charliermarsh.ruff"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
||||
"python.testing.pytestEnabled": true,
|
||||
"python.testing.pytestArgs": ["tests/", "-v", "--ignore=tests/benchmarks"],
|
||||
"ruff.importStrategy": "fromEnvironment",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "charliermarsh.ruff"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== MemPalace Dev Container Setup ==="
|
||||
|
||||
pip install -e ".[dev]"
|
||||
|
||||
# Match CI's ruff pin (pyproject only sets a floor; without this contributors
|
||||
# get a newer ruff locally than CI runs, causing phantom lint failures).
|
||||
pip install "ruff>=0.4.0,<0.5"
|
||||
|
||||
pip install pre-commit
|
||||
pre-commit install
|
||||
|
||||
echo ""
|
||||
echo "=== Verification ==="
|
||||
echo "python: $(python --version)"
|
||||
echo "pytest: $(python -m pytest --version 2>&1 | head -1)"
|
||||
echo "ruff: $(python -m ruff --version 2>&1 | head -1)"
|
||||
echo ""
|
||||
echo "Ready. Run: pytest tests/ -v --ignore=tests/benchmarks"
|
||||
Reference in New Issue
Block a user