Skip to content

Conversation

@bishoy-at-pieces
Copy link
Collaborator

Problem

The update-sdks workflow was failing at the sdk_patch.py step with:

ModuleNotFoundError: No module named 'pieces'

The sdk_patch.py script imports modules from pieces._vendor.pieces_os_client to test the patched enums. In GitHub Actions, the pieces package wasn't in Python's path, causing the import to fail.

Solution

Added the src directory to PYTHONPATH before running sdk_patch.py:

PYTHONPATH="${PYTHONPATH}:${PWD}/src" python sdk_patch.py

This allows Python to find and import the pieces module from the src/pieces directory.

Testing

✅ Verified locally that the command works with the PYTHONPATH set
✅ All 53+ enum patches succeed with this fix

The sdk_patch.py script imports modules from pieces._vendor.pieces_os_client
to test the patched enums. In GitHub Actions, the pieces package wasn't in
Python's path, causing ModuleNotFoundError.

This fix adds the src directory to PYTHONPATH before running sdk_patch.py,
allowing Python to find and import the pieces module.
Copy link
Contributor

Copilot AI left a comment

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 fixes a module import error in the update-sdks workflow by adding the src directory to PYTHONPATH when executing sdk_patch.py. The script requires access to the pieces package to test patched enum classes, which wasn't available in the GitHub Actions environment without this path configuration.

Key Changes:

  • Modified the SDK patching step to include PYTHONPATH environment variable pointing to the src directory

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

@tsavo-at-pieces tsavo-at-pieces self-requested a review December 8, 2025 19:00
Copy link
Contributor

@tsavo-at-pieces tsavo-at-pieces left a comment

Choose a reason for hiding this comment

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

LGTM

@bishoy-at-pieces bishoy-at-pieces merged commit 8c05ea3 into main Dec 8, 2025
13 checks passed
@bishoy-at-pieces bishoy-at-pieces deleted the fix/update-sdks-workflow-pythonpath branch December 8, 2025 19:15
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.

3 participants