Python Project Workflow
Use this skill for Python code changes in a repository.
Workflow
- Inspect the relevant module and matching tests before editing.
- Prefer configuration-driven behavior from existing schemas, JSON/YAML/TOML files or local helpers.
- Keep edits scoped to the requested parser, filter, GUI, comparison, reporting or service path.
- Add or update focused tests when behavior changes.
- Run the narrowest relevant
pytestcommand first, then broader tests if the change touches shared code.
Validation Commands
- Focused test file:
venv/bin/python -m pytest path/to/test_file.py - All tests:
venv/bin/python -m pytest - If the repo provides scripts, prefer documented commands such as
scripts/RUN_TESTS.shorscripts/RUN_COVERAGE.sh.
Generic Conventions
- Application code commonly lives under
src/. - Tests commonly live under
tests/. - Configuration commonly lives under
config/,pyproject.toml,setup.cfg,.ini,.json,.yamlor.tomlfiles. - For generated UI/code artifacts, edit the source artifact first when identifiable, then regenerate using the existing project process.
- Avoid editing logs, generated reports, coverage HTML, or cached bytecode.
Test Mapping Heuristic
- Parser/filter changes: look for
tests/parser/,tests/filter/, or integration tests. - Model changes: look for
tests/models/. - GUI logic: look for GUI-specific tests or Qt test folders.
- Reporting/comparison changes: look for tests named after the changed module or feature.