Skip to content

remove samples from wheel#194

Merged
joamatab merged 1 commit intomainfrom
remove_samples_from_wheel
Jan 8, 2026
Merged

remove samples from wheel#194
joamatab merged 1 commit intomainfrom
remove_samples_from_wheel

Conversation

@joamatab
Copy link
Contributor

@joamatab joamatab commented Jan 8, 2026

Summary by Sourcery

Ensure sample files are excluded from release artifacts by removing sample directories during the release workflow.

Enhancements:

  • Activate the PDK in the sample route script to initialize the environment before running the example.

Build:

  • Add a Makefile target to remove sample directories before packaging.

CI:

  • Invoke the new Makefile target in the release workflow to delete sample files prior to publishing releases.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR ensures the sample scripts are removed from built artifacts and that the remaining sample that is still used activates the PDK before creating components, by adding a Make target and wiring it into the release workflow.

Sequence diagram for updated get_route_sc sample execution

sequenceDiagram
    actor User
    participant Script_get_route_sc as get_route_sc.py
    participant PDK
    participant GDSFactory as gdsfactory
    participant Cells as cells

    User->>Script_get_route_sc: Execute script
    Script_get_route_sc->>PDK: activate()
    PDK-->>Script_get_route_sc: PDK activated
    Script_get_route_sc->>GDSFactory: Component("sample_connect")
    GDSFactory-->>Script_get_route_sc: Component c
    Script_get_route_sc->>Cells: mmi1x2()
    Cells-->>Script_get_route_sc: mmi1
    Script_get_route_sc->>Cells: mmi1x2()
    Cells-->>Script_get_route_sc: mmi2
    Script_get_route_sc->>GDSFactory: route(mmi1, mmi2)
    GDSFactory-->>Script_get_route_sc: route_sc
    Script_get_route_sc->>GDSFactory: show(c)
    GDSFactory-->>User: Rendered layout
Loading

File-Level Changes

Change Details Files
Ensure remaining sample script activates the PDK before use.
  • Import PDK from the cband package alongside existing cells and tech imports.
  • Call PDK.activate() in the main guard before creating any components.
cspdk/si220/cband/samples/get_route_sc.py
Remove sample directories as part of the release process so they are not included in wheels.
  • Add an rm-samples Makefile target that deletes all samples directories for multiple PDK variants.
  • Hook the rm-samples target into the GitHub release workflow prior to Python setup.
Makefile
.github/workflows/release.yml

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

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 rm-samples Makefile target is quite destructive if run locally (it does rm -rf on multiple directories); consider scoping it to the release workflow only (e.g., via a more explicit target name or a guard variable) to reduce accidental use by developers.
  • Instead of hardcoding each samples path in the rm-samples rule, consider using a pattern or a single root directory (e.g., find cspdk -type d -name samples -exec rm -rf {} +) to make it easier to maintain as new PDKs or sample directories are added.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `rm-samples` Makefile target is quite destructive if run locally (it does `rm -rf` on multiple directories); consider scoping it to the release workflow only (e.g., via a more explicit target name or a guard variable) to reduce accidental use by developers.
- Instead of hardcoding each samples path in the `rm-samples` rule, consider using a pattern or a single root directory (e.g., `find cspdk -type d -name samples -exec rm -rf {} +`) to make it easier to maintain as new PDKs or sample directories are added.

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.

@joamatab joamatab added the dependencies Pull requests that update a dependency file label Jan 8, 2026
@joamatab joamatab merged commit f04375d into main Jan 8, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant