Skip to content
Merged
27 changes: 27 additions & 0 deletions BOTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Notes for AI Assistants

## Development Environment

The Python virtual environment is likely located at `./venv`, but this is just a guess - the user may have it elsewhere or may have already activated a virtualenv. If commands like `python` or `pytest` work directly, the environment is probably already active.

If you need to use the venv explicitly:

```bash
./venv/bin/python -m pytest src/toil/test/path/to/test.py -v
./venv/bin/python -c "import toil; print(toil.__version__)"
```

## Running Tests

Tests use pytest. Example commands:

```bash
# Run a specific test file
./venv/bin/python -m pytest src/toil/test/server/safeFileTest.py -v

# Run a specific test
./venv/bin/python -m pytest src/toil/test/server/safeFileTest.py::TestSafeFileInterleaving::test_reader_blocked_while_writer_holds_lock -v

# Run tests with a keyword filter
./venv/bin/python -m pytest src/toil/test -k "safe" -v
```
1 change: 1 addition & 0 deletions CLAUDE.md
2 changes: 1 addition & 1 deletion src/toil/server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def safe_read_file(file: str) -> str | None:

try:
# acquire a shared lock on the state file, which is blocking until we can lock it
fcntl.lockf(file_obj.fileno(), fcntl.LOCK_SH)
fcntl.flock(file_obj.fileno(), fcntl.LOCK_SH)

try:
return file_obj.read()
Expand Down
Loading