[ci:release] Integrate Python runtime release properly#15033
Conversation
🦋 Changeset detectedLatest commit: 478d73d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-ppgufls2o.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-ppgufls2o.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python runtime wheel was also built for this PR. |
🧪 Unit Test StrategyComparing: Strategy: Code changed outside of a package - running all unit tests Affected packages - 40 (100%)
Results
This comment is automatically generated based on the affected testing strategy |
eac3994 to
d6cb351
Compare
Currently the vercel-runtime Python package gets pushed to PyPI _after_
all e2e and npm publishing was done via workflow dispatch to
`release-python-runtime.yml`. This is problematic because the Python
builder pins the runtime version _exactly_ and would fail to find the
yet-unreleased package version on PyPI when running e2e tests.
A simple fix would be to publish to PyPI before e2e, but that defeats
the purpose of pre-release testing. Instead, here we follow the
JavaScript package procedure where we push artifacts to Vercel and test
on those. For Python this means that we inject `VERCEL_RUNTIME_PYTHON`
pointing to `vercel-runtime @ ${{ dplUrl }}/tarballs/vercel-runtime.whl`
alongside `VERCEL_CLI_VERSION`.
The remaining issue is to make sure that PyPI publication succeeds
_before_ we proceed with the main CLI publication, otherwise we will
release a broken build. Achieve this by moving the PyPI publication step
into `ci:publish` so it runs before `pnpm publish`.
Specific changes:
- Add `python/vercel-runtime/publish.mjs` (version check, build, smoke
test, publish)
- Add `utils/publish-runtimes.mjs` which gets called from `ci:publish`
for dispatch (mostly just generalizing non-JS publication here).
- Remove async `workflow_dispatch` trigger and `push` trigger from
`release-python-runtime.yml` (`workflow_dispatch` kept for now for
manual publication if we need it).
- `api/_lib/script/build.ts` learns to scan and copy
`python/**/dist/*.whl` so they are accessible in pre-release e2e.
- tarball comment amended to include `VERCEL_RUNTIME_PYTHON` if
Python runtime changed since last release.
2ced398 to
478d73d
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## vercel@50.18.0 ### Minor Changes - Support easier auth from cursor / claude ([#15050](#15050)) ### Patch Changes - non-interactive mode for link ([#14884](#14884)) - Add experimental manual deployment support ([#14857](#14857)) - Fix `integration remove`, `integration balance`, and `integration open` commands failing to find integrations by explicitly passing `teamId` to the configurations API ([#15054](#15054)) - Require slash syntax for multi-product integrations in non-TTY mode, keep interactive product selector for TTY ([#15047](#15047)) - Move builders back into bundle ([#15059](#15059)) - Updated dependencies \[[`463395162462988e7d3276781d2fdff0685e225b`](4633951), [`6e58410ff849c281735c6acae59b3b0e86136f15`](6e58410)]: - @vercel/go@3.4.1 - @vercel/ruby@2.3.1 - @vercel/python@6.13.0 - @vercel/static-build@2.8.37 ## @vercel/python@6.13.0 ### Minor Changes - Add runtime dependency install to support larger Python functions ([#14976](#14976)) This adds logic to calculate the total size of a lambda at build time and offload dependencies to a \_runtime_requirements.txt file so they can be installed at runtime by uv. This allows us to deploy functions up to the total size of the /tmp folder. ## @vercel/client@17.2.42 ### Patch Changes - Add experimental manual deployment support ([#14857](#14857)) ## @vercel/fs-detectors@5.8.7 ### Patch Changes - [services] infer workspace from manifest: when workspace is not explicitly configured, infer from nearest manifest to entrypoint ([#14986](#14986)) ## @vercel/go@3.4.1 ### Patch Changes - Forward Go and Ruby dev server output through `startDevServer` stdout/stderr callbacks so service logs are correctly prefixed in multi-service `vercel dev`. ([#14989](#14989)) ## @vercel/ruby@2.3.1 ### Patch Changes - Forward Go and Ruby dev server output through `startDevServer` stdout/stderr callbacks so service logs are correctly prefixed in multi-service `vercel dev`. ([#14989](#14989)) ## @vercel/python-runtime@0.4.1 ### Patch Changes - fix PyPI publication integration in release flow ([#15033](#15033)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Currently the vercel-runtime Python package gets pushed to PyPI after
all e2e and npm publishing was done via workflow dispatch to
release-python-runtime.yml. This is problematic because the Pythonbuilder pins the runtime version exactly and would fail to find the
yet-unreleased package version on PyPI when running e2e tests.
A simple fix would be to publish to PyPI before e2e, but that defeats
the purpose of pre-release testing. Instead, here we follow the
JavaScript package procedure where we push artifacts to Vercel and test
on those. For Python this means that we inject
VERCEL_RUNTIME_PYTHONpointing to
vercel-runtime @ ${{ dplUrl }}/tarballs/vercel-runtime.whlalongside
VERCEL_CLI_VERSION.The remaining issue is to make sure that PyPI publication succeeds
before we proceed with the main CLI publication, otherwise we will
release a broken build. Achieve this by moving the PyPI publication step
into
ci:publishso it runs beforepnpm publish.Specific changes:
python/vercel-runtime/publish.mjs(version check, build, smoketest, publish)
utils/publish-runtimes.mjswhich gets called fromci:publishfor dispatch (mostly just generalizing non-JS publication here).
workflow_dispatchtrigger andpushtrigger fromrelease-python-runtime.yml(workflow_dispatchkept for now formanual publication if we need it).
api/_lib/script/build.tslearns to scan and copypython/**/dist/*.whlso they are accessible in pre-release e2e.Warning
High Risk Change
This PR modifies CI/CD release workflows and publishing scripts to integrate Python runtime publication before npm publish, which is infrastructure/deployment configuration affecting the release process.
ci:publishscript to run Python runtime publish before npm publishenvironment: releaseand Python setup stepsRisk assessment for commit 478d73d.