Skip to content

Python cache refactor & docs update#15

Merged
kenorb merged 1 commit into
masterfrom
opencode/dispatch-d8a6de-20260525133913
May 25, 2026
Merged

Python cache refactor & docs update#15
kenorb merged 1 commit into
masterfrom
opencode/dispatch-d8a6de-20260525133913

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

I have improved the copilot-setup-steps.yml workflow by replacing the manual actions/cache step with the built-in caching feature of actions/setup-python. This simplifies the workflow while maintaining efficient dependency management. I also updated the corresponding AGENTS.md file to reflect these changes and verified the modifications using pre-commit (including actionlint and yamllint).

Key Changes:

  • Workflow Update: Configured actions/setup-python to use cache: pip with the dependency path set to .devcontainer/requirements.txt.
  • Cleanup: Removed the manual Restore Python user site cache step and the conditional logic for dependency installation, as pip install will now leverage the cached downloads automatically.
  • Documentation: Updated .github/workflows/AGENTS.md to reflect that Python dependencies are now cached via the native setup-python mechanism.
  • Validation: Verified the changes passed all linting and validation gates via pre-commit.

Triggered by workflow_dispatch

New%20session%20-%202026-05-25T13%3A39%3A12.867Z
opencode session  |  github run

Co-authored-by: kenorb <kenorb@users.noreply.github.com>
@sourcery-ai

sourcery-ai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the Copilot setup workflow to use the native pip cache in actions/setup-python instead of a separate actions/cache step, simplifying dependency installation logic and updating the AGENTS documentation to match.

File-Level Changes

Change Details Files
Use built-in pip caching from actions/setup-python instead of a separate actions/cache step for Python dependencies.
  • Configured actions/setup-python to enable pip caching with cache: pip.
  • Pointed cache-dependency-path to .devcontainer/requirements.txt so cache keys are derived from dependency definitions.
  • Removed the standalone Restore Python user site caching step that used actions/cache.
.github/workflows/copilot-setup-steps.yml
Simplify dependency installation logic now that caching is handled by setup-python.
  • Removed conditional execution of the pip install step based on the previous cache hit output.
  • Kept a single unconditional python -m pip install --user -r .devcontainer/requirements.txt step that now leverages the setup-python cache implicitly.
  • Left PATH configuration for ~/.local/bin unchanged to preserve behavior.
.github/workflows/copilot-setup-steps.yml
Align workflow documentation with the new Python caching mechanism.
  • Updated the caching description to state that Python dependencies are cached via actions/setup-python (pip).
  • Clarified that the cache is still keyed against .devcontainer/requirements.txt while removing reference to the ~/.local user site cache.
.github/workflows/AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The change from caching ~/.local to using cache: pip alters behavior from restoring installed site-packages to only restoring the pip download cache; if startup time was important, consider noting or measuring the impact of reinstalling dependencies on every run.
  • Given that pip install --user is now always executed, confirm that this is intentional for reproducibility; if not, you may want to reintroduce a lightweight guard (e.g., checking a marker file) to skip redundant installs while still leveraging the pip cache.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The change from caching `~/.local` to using `cache: pip` alters behavior from restoring installed site-packages to only restoring the pip download cache; if startup time was important, consider noting or measuring the impact of reinstalling dependencies on every run.
- Given that `pip install --user` is now always executed, confirm that this is intentional for reproducibility; if not, you may want to reintroduce a lightweight guard (e.g., checking a marker file) to skip redundant installs while still leveraging the pip cache.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@kenorb kenorb merged commit 36d5e0f into master May 25, 2026
11 checks passed
@kenorb kenorb deleted the opencode/dispatch-d8a6de-20260525133913 branch May 25, 2026 21:03
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.

1 participant