Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 6, 2025

This PR adds a .github/copilot-setup-steps.yml file to configure the development environment when GitHub Copilot is launched in the repository.

Configuration Details

The setup file is structured as a proper GitHub Actions workflow that configures a Python 3.13 environment using Micromamba with the following components:

Workflow Structure

  • Name: "Copilot Setup Steps"
  • Triggers: workflow_dispatch, push, and pull_request for the copilot-setup-steps.yml file
  • Job: copilot-setup-steps running on ubuntu-latest
  • Permissions: contents: read for repository checkout
  • Steps: Includes checkout action followed by Micromamba setup and dependency installation

Core Dependencies

  • Python 3.13
  • NumPy >= 2.0
  • MKL, SciPy, pip, and mkl-service
  • Build tools: graphviz, cython
  • Testing framework: pytest, coverage, pytest-cov, pytest-benchmark, pytest-mock, pytest-sphinx

Optional Backend Support

  • JAX: Includes jax, jaxlib, numpyro, equinox, and tfp-nightly
  • Numba: numba >= 0.57

Excluded Dependencies

  • PyTorch is intentionally excluded from this configuration

The configuration follows the GitHub Copilot documentation format for customizing the agent environment and is based on the existing .github/workflows/test.yml CI workflow, using the same Micromamba setup pattern (version 1.5.10-0) to ensure consistency between local development and CI environments.

This file will help contributors quickly set up a working development environment with the necessary dependencies for working on PyTensor and allows for easy validation through GitHub Actions.

Original prompt

Please create a new file named .github/copilot-setup-steps.yml in the pymc-devs/pytensor repository.

This file will be used by GitHub Copilot to set up a working environment when it's launched in the repository. The setup is based on the existing .github/workflows/test.yml file and is configured to:

  • Use Python 3.13.
  • Install the default dependencies.
  • Install JAX and Numba dependencies.
  • Exclude PyTorch.

Here is the content for the .github/copilot-setup-steps.yml file:

steps:
  - name: "Set up Micromamba"
    uses: mamba-org/setup-micromamba@v2
    with:
      environment-name: pytensor-test
      micromamba-version: "1.5.10-0"
      init-shell: bash
      post-cleanup: "all"
      create-args: python=3.13

  - name: "Install dependencies"
    shell: micromamba-shell {0}
    run: |
      micromamba install --yes -q -c conda-forge python=3.13 mkl "numpy>=2.0" scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock pytest-sphinx
      micromamba install --yes -q -c conda-forge "numba>=0.57"
      micromamba install --yes -q -c conda-forge jax jaxlib numpyro equinox
      pip install tfp-nightly
      pip install -e ./
*This pull request was created as a result of the following prompt from Copilot chat.* > Please create a new file named `.github/copilot-setup-steps.yml` in the `pymc-devs/pytensor` repository. > > This file will be used by GitHub Copilot to set up a working environment when it's launched in the repository. The setup is based on the existing `.github/workflows/test.yml` file and is configured to: > - Use Python 3.13. > - Install the default dependencies. > - Install JAX and Numba dependencies. > - Exclude PyTorch. > > Here is the content for the `.github/copilot-setup-steps.yml` file: > > ```yaml > steps: > - name: "Set up Micromamba" > uses: mamba-org/setup-micromamba@v2 > with: > environment-name: pytensor-test > micromamba-version: "1.5.10-0" > init-shell: bash > post-cleanup: "all" > create-args: python=3.13 > > - name: "Install dependencies" > shell: micromamba-shell {0} > run: | > micromamba install --yes -q -c conda-forge python=3.13 mkl "numpy>=2.0" scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock pytest-sphinx > micromamba install --yes -q -c conda-forge "numba>=0.57" > micromamba install --yes -q -c conda-forge jax jaxlib numpyro equinox > pip install tfp-nightly > pip install -e ./ > ``` >

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… setup

Co-authored-by: ricardoV94 <28983449+ricardoV94@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] feat: Add Copilot setup configuration Add GitHub Copilot setup configuration file Oct 6, 2025
@Copilot Copilot AI requested a review from ricardoV94 October 6, 2025 14:13
Copilot finished work on behalf of ricardoV94 October 6, 2025 14:13
@ricardoV94
Copy link
Member

@copilot copilot According to the docs: 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

A copilot-setup-steps.yml file looks like a normal GitHub Actions workflow file, but must contain a single copilot-setup-steps job. This job will be executed in GitHub Actions before Copilot starts working.

Example:

name: "Copilot Setup Steps"

# 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:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  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

    # 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@v5

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install JavaScript dependencies
        run: npm ci

Please update the file to follow the requirements as mentioned in the docs

Co-authored-by: ricardoV94 <28983449+ricardoV94@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 6, 2025

@copilot copilot According to the docs: https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-depend...

Updated the file to follow the proper GitHub Actions workflow format as specified in the documentation. The file now includes:

  • Workflow name and triggers (workflow_dispatch, push, pull_request)
  • A copilot-setup-steps job running on ubuntu-latest
  • Proper permissions (contents: read)
  • Checkout step before the setup steps

Changes committed in 6a6e2a4.

Copilot finished work on behalf of ricardoV94 October 6, 2025 14:20
@ricardoV94 ricardoV94 requested a review from maresb October 6, 2025 14:20
@ricardoV94 ricardoV94 marked this pull request as ready for review October 6, 2025 14:20
@ricardoV94
Copy link
Member

ricardoV94 commented Oct 6, 2025

should this be inside the workflows directory? The docs above state it should go directly in .github, but then reference regular workflows for the API. I guess we can just try or find another repo where it's working

@ricardoV94
Copy link
Member

Talked with @maresb, he agreed to just merge and see

@ricardoV94 ricardoV94 merged commit 1cf88cb into main Oct 7, 2025
18 checks passed
@twiecki twiecki deleted the copilot/fix-16084410-e883-46a7-970b-8340c1d82e19 branch October 8, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants