Skip to content

Commit 11ffd31

Browse files
Copilotncrmro
andauthored
chore: implement working uv/pytest environment in copilot-setup-steps workflow and add documentation (#126)
* Initial plan * Update copilot-setup-steps.yml with working uv/pytest environment Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Improve verification step with ruff check and direct tool invocation Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Fix pytest/ruff verification to use uv run instead of python -m Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add commented Nix setup to explain why uv/Python is used instead Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add .github/copilot-instructions.md documenting development setup for Copilot agents Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Make copilot-instructions.md terse - focus on AGENTS.md reference, tools, and tests Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> Co-authored-by: Nicholas Romero <ncrmro@gmail.com>
1 parent 22d4550 commit 11ffd31

2 files changed

Lines changed: 75 additions & 13 deletions

File tree

.github/copilot-instructions.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# GitHub Copilot Development Environment
2+
3+
**Primary agent instructions**: See [`AGENTS.md`](../AGENTS.md) for complete repository context.
4+
5+
## Environment Setup
6+
7+
GitHub Copilot agents use uv/Python (not Nix) because Nix causes Bash tool calls to hang. Setup is handled by `.github/workflows/copilot-setup-steps.yml`:
8+
9+
```bash
10+
uv sync --extra dev
11+
```
12+
13+
## Available Tools
14+
15+
All tools must be run via `uv run`:
16+
17+
| Tool | Command |
18+
|------|---------|
19+
| **pytest** | `uv run pytest tests/ -v` |
20+
| **ruff** | `uv run ruff check src/` |
21+
| **mypy** | `uv run mypy src/` |
22+
| **deepwork** | `uv run deepwork` |
23+
24+
## Running Tests
25+
26+
```bash
27+
# All tests
28+
uv run pytest tests/ -v
29+
30+
# Specific test file
31+
uv run pytest tests/test_example.py -v
32+
33+
# With coverage
34+
uv run pytest tests/ --cov=deepwork --cov-report=html
35+
```

.github/workflows/copilot-setup-steps.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,49 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18-
# TODO this will cause all of copilot agents Bash tool calls to silently hang (which it won't complain about)
18+
# NOTE: Nix would be the preferred environment, but it causes Copilot agent
19+
# Bash tool calls to silently hang. Using uv/Python setup as a workaround.
1920
# - name: Install Nix
2021
# uses: cachix/install-nix-action@v31
2122
# with:
2223
# nix_path: nixpkgs=channel:nixos-unstable
2324
# - uses: nicknovitski/nix-develop@v1
2425

25-
# - name: Cache UV dependencies
26-
# uses: actions/cache@v4
27-
# with:
28-
# path: |
29-
# ~/.cache/uv
30-
# .venv
31-
# key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
32-
# restore-keys: |
33-
# ${{ runner.os }}-uv-
34-
35-
# - name: Install dependencies
36-
# run: uv sync --extra dev
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
version: "latest"
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.11"
35+
36+
- name: Cache UV dependencies
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
~/.cache/uv
41+
.venv
42+
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-uv-
45+
46+
- name: Install dependencies
47+
run: uv sync --extra dev
48+
49+
- name: Verify environment setup
50+
run: |
51+
echo "Python version:"
52+
python --version
53+
echo ""
54+
echo "UV version:"
55+
uv --version
56+
echo ""
57+
echo "Pytest available:"
58+
uv run pytest --version
59+
echo ""
60+
echo "Ruff available:"
61+
uv run ruff --version
62+
echo ""
63+
echo "Environment setup complete!"

0 commit comments

Comments
 (0)