Skip to content

Commit 54647d4

Browse files
committed
Add copilot-instructions.md and clarify Docker testing in AGENTS.md
Add .github/copilot-instructions.md for GitHub Copilot, mirroring CLAUDE.md with a pointer to AGENTS.md for full project guidance. Update AGENTS.md to document that source code changes under src/viral_ngs/ require pip install -e inside the container, since the package is pre-installed in the image and volume mounts alone do not override Python imports.
1 parent b06089d commit 54647d4

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/copilot-instructions.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copilot Instructions
2+
3+
This file provides guidance to GitHub Copilot when working with code in this repository.
4+
5+
**IMPORTANT**: Always read [AGENTS.md](../AGENTS.md) at the start of every session before doing any work. It contains comprehensive project context and development guidelines that are essential for working in this codebase.
6+
7+
## Quick Reference
8+
9+
- **Docker-centric development**: Run tests inside containers, not on host
10+
- **Import pattern**: `from viral_ngs import core` then `core.samtools.SamtoolsTool()`
11+
- **Test location**: `tests/unit/<module>/`
12+
- **Dependencies**: ALL via conda, not pip (see `docker/requirements/*.txt`)
13+
14+
## Running Tests
15+
16+
```bash
17+
docker run --rm \
18+
-v $(pwd):/opt/viral-ngs/source \
19+
quay.io/broadinstitute/viral-ngs:main-core \
20+
pytest -rsxX -n auto /opt/viral-ngs/source/tests/unit
21+
```
22+
23+
## Key Files
24+
25+
| File | Purpose |
26+
|------|---------|
27+
| [AGENTS.md](../AGENTS.md) | Full AI assistant guidance |
28+
| [pyproject.toml](../pyproject.toml) | Package configuration |
29+
| [docker/](../docker/) | Dockerfiles and requirements |
30+
| [src/viral_ngs/](../src/viral_ngs/) | Source code |
31+
| [tests/](../tests/) | Test files |

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ docker run --rm \
6969
pytest -rsxX -n auto /opt/viral-ngs/source/tests/unit/classify
7070
```
7171

72+
**Important: Testing source code changes requires re-installing the package.**
73+
The `-v` mount makes your local files visible on disk, but `viral_ngs` is already installed as a package inside the container image. Python imports resolve to the *installed* copy, not your mounted source files. If you've modified files under `src/viral_ngs/`, you must re-install before running tests:
74+
75+
```bash
76+
# Run tests with local source changes applied
77+
docker run --rm \
78+
-v $(pwd):/opt/viral-ngs/source \
79+
quay.io/broadinstitute/viral-ngs:main-core \
80+
bash -c "pip install -e /opt/viral-ngs/source --quiet && pytest -rsxX -n auto /opt/viral-ngs/source/tests/unit"
81+
```
82+
83+
Changes to test files (`tests/`) and test inputs (`tests/input/`) are picked up automatically via the volume mount — the re-install is only needed when modifying the `src/viral_ngs/` package code.
84+
85+
Running pytest directly on the host will generally not work — most dependencies (bioinformatics tools, conda packages) are only available inside the Docker containers. Always test inside Docker.
86+
7287
**Test conventions:**
7388
- Uses pytest (not nose or unittest)
7489
- Test files in `tests/unit/<module>/`

0 commit comments

Comments
 (0)