Add pypi client release check#186
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| python-version: | ||
| description: Python version to install | ||
| required: false | ||
| default: "3.12" |
There was a problem hiding this comment.
Can we remove the default and make it fail if the project python version is not defined? It should never be undefined.
| cache-dependency-glob: | ||
| description: Multiline glob of files to include in the cache key | ||
| required: false | ||
| default: | |
There was a problem hiding this comment.
Let's add the source code as part of the cache key too
There was a problem hiding this comment.
This should always include the entire package dir and the input should be an extra-cache-dependency-glob
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
| pyproject-file: ${{ inputs.package-dir }}/pyproject.toml | ||
| cache-dependency-glob: | |
| pyproject-path: ${{ inputs.package-dir }}/pyproject.toml | ||
|
|
||
| - name: Build and publish to PyPI | ||
| if: steps.version_check.outputs.local_version_is_higher == 'true' |
There was a problem hiding this comment.
I suppose, but uv already handles the publishing. FastAPI uses the uv built-in method for the release github action https://github.com/fastapi/fastapi/blob/master/.github/workflows/publish.yml
| echo "version=$(cat pyproject.toml | grep '^version = ' | head -1 | sed 's/version = \"\([^\"]*\)\"/\1/')" >>$GITHUB_OUTPUT | ||
| - name: Read project version | ||
| id: project_version | ||
| uses: SebRollen/toml-action@v1.2.0 |
There was a problem hiding this comment.
You should use the same version check plugin than before. In the outputs it exports the local version (outputs.local_version)
There was a problem hiding this comment.
That action also queries PyPI to compute local_version_is_higher. For the root pyproject.toml whose name may not be a PyPI package, the PyPI lookup will return nothing. local_version is still populated from the file, so the release step works, but the action may log a warning.
| with: | ||
| package-name: optimuskg | ||
| package-dir: packages/optimuskg | ||
| python-version: "3.12" |
There was a problem hiding this comment.
Should be read from project

No description provided.