Commit 41872d2
feat: set up Copilot agent environment with uv, pre-commit, and GitHub Actions workflow (#536)
This PR sets up the Copilot agent environment following GitHub's
official documentation to improve the development experience for
AI-assisted coding.
## Changes Made
**Copilot Setup Workflow:**
- Created `.github/workflows/copilot-setup-steps.yml` following GitHub's
official documentation and example structure
- Added proper workflow triggers (workflow_dispatch, push, pull_request)
with path filtering for easy validation
- Configured minimal permissions (`contents: read`) as recommended by
GitHub
- Pre-configures Copilot's environment with Python 3.11, uv package
manager, and all project dependencies
- Installs development tools (pre-commit, pyright) and sets up
pre-commit hooks automatically
- Uses pip-based uv installation to avoid network restrictions in
Copilot environment
- Verifies installation to ensure environment is properly configured
before agent starts
**Environment Setup:**
- Implemented `uv` for Python environment and dependency management
(faster than pip)
- Added `uv tool install` for development tools (`pre-commit`,
`pyright`)
- Configured `pre-commit` as the preferred tool for code quality checks
**Updated Copilot Instructions:**
- Modified `.github/copilot-instructions.md` to prefer `pre-commit run
--all-files` over direct `ruff` usage
- Added comprehensive Copilot agent environment setup section
- Updated validation workflow to use modern tooling
- Added fallback instructions for network-restricted environments
**Configuration Fixes:**
- Updated `pyproject.toml` to use modern ruff configuration format
(`[tool.ruff.lint]`)
- Eliminated deprecation warnings about top-level linter settings
- Removed deprecated `ignore-init-module-imports` option
## Benefits
- **Reliable agent environment** through pre-configured workflow steps
that run before the agent starts
- **Faster dependency resolution** with `uv` package manager
- **Network restriction compatibility** by avoiding blocked domains
during setup
- **Comprehensive code quality checks** through pre-commit hooks (ruff,
prettier, velin, blacken-docs)
- **Better developer experience** for Copilot agents with proper tool
installation
- **Modern tooling practices** following GitHub's recommendations
- **Consistent code quality** across all contributors
The copilot-setup-steps.yml workflow ensures that Copilot agents have a
deterministic, fast, and reliable environment setup instead of relying
on trial-and-error dependency discovery.
Fixes #535.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/deepmodeling/dpdispatcher/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent 43d6e67 commit 41872d2
File tree
3 files changed
+95
-10
lines changed- .github
- workflows
3 files changed
+95
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
56 | 76 | | |
57 | 77 | | |
58 | 78 | | |
| |||
70 | 90 | | |
71 | 91 | | |
72 | 92 | | |
73 | | - | |
| 93 | + | |
74 | 94 | | |
75 | 95 | | |
76 | 96 | | |
| |||
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
84 | | - | |
| 104 | + | |
85 | 105 | | |
86 | 106 | | |
87 | 107 | | |
| |||
161 | 181 | | |
162 | 182 | | |
163 | 183 | | |
164 | | - | |
| 184 | + | |
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
169 | 189 | | |
170 | 190 | | |
| 191 | + | |
171 | 192 | | |
172 | 193 | | |
173 | 194 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | 113 | | |
115 | | - | |
| 114 | + | |
116 | 115 | | |
0 commit comments