-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add copilot instructions and setup steps #4884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
harshil21
wants to merge
7
commits into
master
Choose a base branch
from
copilot-instructions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
be17f3f
Add copilot instructions and setup steps
harshil21 53e3082
Add chango fragment for PR #4884
harshil21 b54a854
Review: comments, version pinning, latest sha
harshil21 60bcc77
Pin setup-uv version in workflow
harshil21 fdc7ede
Pin setup-uv version as a sha
harshil21 e430ff7
Review: zizmor, update instructions
harshil21 b1d6c30
Review: Change back contents from write to read
harshil21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
This is a python project which is a wrapper for the Telegram Bot API. Please read the contributing | ||
guidelines mentioned in .github/CONTRIBUTING.rst to know how to contribute to this project. The | ||
README.rst file lists the features and usage of the project. | ||
|
||
### Development Environment: | ||
|
||
Your development environment is set up using `uv`, a tool for managing Python environments and dependencies. | ||
Your environment has all extra dependencies and groups installed, on Python 3.13. Please continue using `uv` for managing your development environment, | ||
and for any scripts or tools you need to run. | ||
|
||
Some example commands on `uv`: | ||
- `uv sync --all-extras --all-groups` to install all dependencies and groups required by the project. | ||
- `uv run -p 3.14 --all-groups --all-extras tests/` to run tests on a specific Python version. Please use the `-p` flag often. | ||
- `uv pip install <package>` to install a package in the current environment. | ||
|
||
If uv is somehow not available, you can install it using `pip install uv`. | ||
|
||
### Repository Structure: | ||
|
||
The repository follows a standard structure for Python projects. Here are some key directories and files: | ||
|
||
- `src/`: This directory contains the main source code for the project. | ||
- `tests/`: This directory contains test cases for the project. | ||
- `pyproject.toml`: This file contains the project metadata and dependencies. | ||
- `.github/`: This directory contains GitHub-specific files, including workflows and issue templates. | ||
|
||
|
||
### Things to keep in mind while coding: | ||
|
||
- Ensure that your code is properly and fully typed. All your code should be compatible from | ||
Python 3.9 to 3.14. Don't use the `typing_extensions` module. | ||
Bibo-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Read the stability guide mentioned at docs/source/stability_policy.rst to understand if your changes | ||
are breaking or incompatible. | ||
- Try to make sure your code is asyncio-friendly and thread-safe. | ||
- Run `uv run pre-commit` to run pre-commit hooks before committing your changes, but after `git add`ing them. | ||
- Make sure you always test your changes. Either update or write new tests in the `tests/` directory. | ||
|
||
### Pull Requests: | ||
|
||
When you create a pull request, please also add the appropriate labels to it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This file is for the copilot agent on Github. This helps to set up the development environment | ||
# See the docs here: https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment | ||
name: "Copilot Setup Steps" | ||
|
||
harshil21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Automatically run the setup steps when they are changed to allow for easy validation, and | ||
# allow manual testing through the repository's "Actions" tab | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- .github/workflows/copilot-setup-steps.yml | ||
|
||
jobs: | ||
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. | ||
copilot-setup-steps: | ||
runs-on: ubuntu-latest | ||
|
||
# Set the permissions to the lowest permissions possible needed for your steps. | ||
# Copilot will be given its own token for its operations. | ||
permissions: | ||
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete. | ||
contents: read | ||
pull-requests: write # So copilot can add labels to the PR | ||
|
||
# You can define any steps you want, and they will run before the agent starts. | ||
# If you do not check out your code, Copilot will do this for you. | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Show resolved
Hide resolved
|
||
with: | ||
persist-credentials: false | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc | ||
with: | ||
# Install a specific version of uv. | ||
version: "0.8.3" | ||
# Install 3.13: | ||
python-version: 3.13 | ||
|
||
- name: Install the project | ||
run: uv sync --all-extras --all-groups | ||
|
||
- name: Install linting dependencies | ||
# Make sure the pinned versions here match the ones in .pre-commit-config.yaml | ||
run: uv pip install black==25.1.0 isort==6.0.1 mypy==1.16.1 flake8==7.3.0 ruff==0.12.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
internal = "Add Copilot Instructions and Setup Steps" | ||
[[pull_requests]] | ||
uid = "4884" | ||
author_uid = "harshil21" | ||
closes_threads = [] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.