Test fixtures used 'sam', 'samcharles93', and 'sam/<repo>' as owner names. These are personal and machine-specific — the repo should use generic placeholders like 'acme' (matching the existing convention in worktree_test.go). config.example.toml: samcharles93 -> your-github-username Test owner: sam -> acme Repo refs: sam/archie-core -> acme/archie-core, etc. Example skills: sam -> acme
2.1 KiB
2.1 KiB
name, description, version, metadata
| name | description | version | metadata | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ecosystem-python | Python project conventions for archie-core: venv, pytest, ruff, mypy, pip-audit. Use when working on Python repositories with archie-core. | 1.0.0 |
|
Python Ecosystem Conventions
Preflight
When archie-core's [[repos]] entry sets ecosystem = "python", the daemon runs
python --version as the preflight check before any agent stage.
Recommended gate configuration
[[repos]]
owner = "acme"
name = "my-python-project"
ecosystem = "python"
[[repos.gate]] = ["ruff", "check", "."]
[[repos.gate]] = ["ruff", "format", "--check", "."]
[[repos.gate]] = ["mypy", "."]
[[repos.gate]] = ["pytest", "-x", "--tb=short"]
Test glob
The default test glob for Python is test_*.py. The TDD workflow's repro-tests
stage write-protects files matching this glob during the fix stage.
Override with test_glob = "tests/**/*.py" in the repo config for projects
with test files outside the package root.
Package management
arcie-core assumes:
requirements.txtorpyproject.tomlat the repo root- Tests run with
pytest(the ecosystem default) - Linting with
ruff(recommended) orflake8 - Type checking with
mypy - Security auditing with
pip-audit
Virtual environment
Before the gate runs, ensure dependencies are installed:
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pip install pytest ruff mypy pip-audit
For pyproject.toml projects:
pip install -e ".[dev]"
Common gate failures
ruff
F401: unused import -- remove itE501: line too long -- break the lineI001: import order -- let ruff fix it withruff check --fix
mypy
- Missing type annotation on public function -- add it
Cannot determine type-- add explicit annotation- Import errors -- check the package is installed in the venv
pytest
- Test discovery failed -- check
__init__.pyfiles and test naming - Import errors -- verify the package is installed (
pip install -e .) - Assertion failures -- fix the code, not the test