Skip to content

refactor: separate build, test, and deploy in Python workflow#2308

Merged
samfreund merged 5 commits intoPhotonVision:mainfrom
auscompgeek:refactor/python-workflow-build-test-deploy
Jan 17, 2026
Merged

refactor: separate build, test, and deploy in Python workflow#2308
samfreund merged 5 commits intoPhotonVision:mainfrom
auscompgeek:refactor/python-workflow-build-test-deploy

Conversation

@auscompgeek
Copy link
Contributor

Description

Test what you build, deploy what you test.

This refactors the Python CI workflow to wait for all tests to pass before publishing photonlibpy to PyPI.

  • build-python-examples reuses the built wheel, removes redundant builds
  • Simplify run.sh to not rebuild wheel since it's already installed

Amp-Thread-ID: https://ampcode.com/threads/T-019bc9a4-013e-7428-bc66-89592eb9eb1a

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@auscompgeek auscompgeek requested review from a team as code owners January 17, 2026 13:32
auscompgeek and others added 4 commits January 17, 2026 08:34
- Split build-and-deploy into three jobs: build, test, build-python-examples, deploy
- Build job only builds the wheel and uploads artifact
- Test job downloads artifact and runs tests
- build-python-examples uses the pre-built artifact, removes redundant builds
- Deploy waits for both test and build-python-examples to succeed
- Simplify run.sh to not rebuild wheel since it's already installed

Amp-Thread-ID: https://ampcode.com/threads/T-019bc9a4-013e-7428-bc66-89592eb9eb1a
Co-authored-by: Amp <[email protected]>
- Download artifact to repo root instead of source directory
- Install package before running tests
- Run pytest from repo root so it uses installed package, not source
- Fixes ModuleNotFoundError for photonlibpy.version

Amp-Thread-ID: https://ampcode.com/threads/T-019bc9a4-013e-7428-bc66-89592eb9eb1a
Co-authored-by: Amp <[email protected]>
- Use pytest --import-mode=importlib to use installed package
- Removes need to generate version.py in source
@samfreund samfreund force-pushed the refactor/python-workflow-build-test-deploy branch from be8a251 to aea307a Compare January 17, 2026 14:34
@samfreund samfreund enabled auto-merge (squash) January 17, 2026 15:20
@samfreund samfreund merged commit afb73b3 into PhotonVision:main Jan 17, 2026
58 checks passed
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