Skip to content

Add pypi client release check#186

Merged
lvvittor merged 3 commits into
mainfrom
pypi-release
May 6, 2026
Merged

Add pypi client release check#186
lvvittor merged 3 commits into
mainfrom
pypi-release

Conversation

@lvvittor
Copy link
Copy Markdown
Collaborator

@lvvittor lvvittor commented May 5, 2026

No description provided.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
optimus Ready Ready Preview, Comment May 6, 2026 2:47am

Request Review

@lvvittor lvvittor merged commit 15a5e99 into main May 6, 2026
4 of 5 checks passed
@lvvittor lvvittor deleted the pypi-release branch May 6, 2026 02:52
python-version:
description: Python version to install
required: false
default: "3.12"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we remove the default and make it fail if the project python version is not defined? It should never be undefined.

Comment thread .github/actions/setup-uv/action.yml Outdated
cache-dependency-glob:
description: Multiline glob of files to include in the cache key
required: false
default: |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's add the source code as part of the cache key too

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should always include the entire package dir and the input should be an extra-cache-dependency-glob

Comment thread .github/workflows/publish-pypi.yml Outdated
with:
python-version: ${{ inputs.python-version }}
pyproject-file: ${{ inputs.package-dir }}/pyproject.toml
cache-dependency-glob: |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove

pyproject-path: ${{ inputs.package-dir }}/pyproject.toml

- name: Build and publish to PyPI
if: steps.version_check.outputs.local_version_is_higher == 'true'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this work?

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You should use the same version check plugin than before. In the outputs it exports the local version (outputs.local_version)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should be read from project

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