Skip to content

[collab] Source pip dependencies from environment.yml#328

Merged
mmcky merged 2 commits into
mainfrom
fix/collab-deps-from-environment
Jun 26, 2026
Merged

[collab] Source pip dependencies from environment.yml#328
mmcky merged 2 commits into
mainfrom
fix/collab-deps-from-environment

Conversation

@mmcky

@mmcky mmcky commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

The Colab execution workflow (collab.yml) duplicated the full pip dependency list as a literal pip install line. That copy drifted out of sync with environment.yml: Dependabot's conda ecosystem only updates environment.yml, so after #319 bumped quantecon-book-theme to 0.21.0 the workflow was still pinned to 0.20.2. This was surfaced (and is now superseded) by #303.

This change derives the pip dependencies from environment.yml at build time, giving a single source of truth so the two can no longer diverge:

python -c "import yaml; deps = next(d['pip'] for d in yaml.safe_load(open('environment.yml'))['dependencies'] if isinstance(d, dict) and 'pip' in d); open('colab-requirements.txt', 'w').write('\n'.join(deps) + '\n')"
cat colab-requirements.txt
pip install -r colab-requirements.txt

Why this approach

  • No Dependabot config change needed — it keeps updating environment.yml as before, and the Colab workflow automatically picks up those updates.
  • The container is pip-only (Google Colab runtime image), so we extract just the pip: subsection rather than recreating the conda env.
  • The generated list is printed to the log (cat colab-requirements.txt) for visibility.

Verification

Validated locally that the snippet extracts the correct list (now quantecon-book-theme==0.21.0, matching environment.yml) and that collab.yml is well-formed YAML. The execution-checks job on this PR exercises the new install step end-to-end on GPU.

🤖 Generated with Claude Code

The Colab execution workflow duplicated the full pip dependency list as a
literal `pip install` line, which drifted out of sync with environment.yml
(e.g. quantecon-book-theme was left at 0.20.2 after #319 bumped it to 0.21.0,
since Dependabot only updates environment.yml).

Derive the pip dependencies from environment.yml at build time so there is a
single source of truth and the two can no longer diverge. See #303.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 26, 2026 07:18
@netlify

netlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy Preview for incomparable-parfait-2417f8 ready!

Name Link
🔨 Latest commit 812a770
🔍 Latest deploy log https://app.netlify.com/projects/incomparable-parfait-2417f8/deploys/6a3e2f0f6c772c0008f0b8a4
😎 Deploy Preview https://deploy-preview-328--incomparable-parfait-2417f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Google Colab execution workflow to derive its pip install requirements directly from environment.yml, eliminating drift between the workflow’s pinned dependencies and the repo’s single source of truth.

Changes:

  • Generate colab-requirements.txt at runtime by extracting the pip: dependency list from environment.yml.
  • Install Colab build dependencies via pip install -r colab-requirements.txt (and print the generated list to logs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/collab.yml
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 07:27 Inactive
@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 07:31 Inactive
Don't rely on the Colab runtime image shipping PyYAML — install it explicitly
so the dependency-extraction step is self-contained. Addresses Copilot review
feedback on #328.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pull request June 26, 2026 07:58 Inactive
@mmcky mmcky merged commit 2fa1b83 into main Jun 26, 2026
7 checks passed
@mmcky mmcky deleted the fix/collab-deps-from-environment branch June 26, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants