Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] add testpypi nightly build #1601

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Feb 3, 2025

Closes #872

This PR adds the ability to run and publish pypi artifacts nightly to testpypi. It will publish as pyiceberg with new version under 0.9.0.dev${TIMESTAMP}, i.e. 0.9.0.dev20250206050843, adhering to PEP440 conversion.

Here's a test run on my fork which published to https://test.pypi.org/project/pyiceberg-kevinliu/

This requires setting up Publishing to PyPI with a Trusted Publisher on https://test.pypi.org/ and using example of publishing pyiceberg_core to testpypi

Note, this PR also refactors .github/workflows/python-release.yml, i've ran the workflow on my fork and manually verified the version for both pypi and svn artifacts.

Setup trusted publisher on testpypi for apache/iceberg-python repo https://test.pypi.org/manage/project/pyiceberg/settings/publishing/

@kevinjqliu kevinjqliu force-pushed the kevinjqliu/nightly-pypi-build branch 2 times, most recently from ae00205 to fb47071 Compare February 3, 2025 16:06
.github/workflows/nightly-pypi-build.yml Outdated Show resolved Hide resolved
.github/workflows/nightly-pypi-build.yml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
.github/workflows/nightly-pypi-build.yml Show resolved Hide resolved
@kevinjqliu kevinjqliu force-pushed the kevinjqliu/nightly-pypi-build branch 4 times, most recently from 1c34186 to f833d19 Compare February 3, 2025 18:06
@kevinjqliu kevinjqliu requested a review from Fokko February 3, 2025 18:22
@kevinjqliu
Copy link
Contributor Author

@Fokko can you take a look at the general flow? I tested in my fork. WYDT about setting the version to 0.9.0rc20250203?

@kevinjqliu kevinjqliu marked this pull request as ready for review February 3, 2025 18:23
@kevinjqliu kevinjqliu force-pushed the kevinjqliu/nightly-pypi-build branch from f833d19 to 3cc5ca1 Compare February 3, 2025 21:19

jobs:
set-version:
if: github.repository == 'apache/iceberg-python' # Only run for apache repo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

verified that workflow is skipped on my forked repo
https://github.com/kevinjqliu/iceberg-python/actions/runs/13123573377

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -35,7 +35,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

What's up with macos-15? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

macos-14, macos-15 are the same hardware so produce the same artifacts. i was getting some error uploading to pypi due to

pypi zipfile.BadZipFile: Bad magic number for central directory

removing macos-15 worked 🤷

Comment on lines +82 to +83
- name: List downloaded artifacts
run: ls -R dist/
Copy link
Contributor

Choose a reason for hiding this comment

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

I was hoping that we could leave out this kind of debug statements. But it looks like the merge job doesn't mention the actual files: https://github.com/kevinjqliu/iceberg-python/actions/runs/13119881319/job/36603748563

@Fokko
Copy link
Contributor

Fokko commented Feb 4, 2025

@kevinjqliu This looks great! Thanks for working on it. Very nice how you re-use the build workflow. I left some small comments on how we can maybe simplify manual dispatch, apart from that it looks great. Let me know if you need any help with setting the credential, I think we need to do that through INFRA

@kevinjqliu kevinjqliu force-pushed the kevinjqliu/nightly-pypi-build branch from 9ecc1ff to 463d425 Compare February 6, 2025 04:47
@kevinjqliu kevinjqliu force-pushed the kevinjqliu/nightly-pypi-build branch 2 times, most recently from f440cc0 to d734943 Compare February 6, 2025 05:18
@kevinjqliu
Copy link
Contributor Author

@Fokko i refactor the code to remove RC, thanks for the suggestion!
I was able to rerun on my fork and published to pyiceberg-kevinliu 0.9.0rc20250203 (I guess pypi changes .dev to rc??)

For setting up trusted publisher, its configured on testpypi. I see you're the maintainer for testpypi pyiceberg, the setting is at https://test.pypi.org/manage/project/pyiceberg/settings/publishing/
Or you can add me and i can configure it

@kevinjqliu kevinjqliu requested a review from Fokko February 6, 2025 05:21
@kevinjqliu
Copy link
Contributor Author

Screenshot 2025-02-06 at 7 41 04 AM

weird, i dont have Manage permission. let me ask sung to see how he did it for pyiceberg_core

@kevinjqliu
Copy link
Contributor Author

oh i see, only "owner" can make this change (from pypi: What collaborator roles are available for a project on PyPI?)

This is what it looks like for pyiceberg-kevinliu
Screenshot 2025-02-06 at 12 00 36 PM

So we should fill it out for pyiceberg like so: Owner: apache(?) Repository name:apache/iceberg-pythonWorkflow name:nightly-pypi-build.ymlEnvironment name:testpypi`

@Fokko can you check if you have permission to do so? otherwise, i can reach out to apache infra

@Fokko
Copy link
Contributor

Fokko commented Feb 6, 2025

@kevinjqliu I just bumped you to owner 👍

Let me check why it converts rc into dev for the artifacts

@kevinjqliu
Copy link
Contributor Author

Thanks! I couldnt find anything about the dev -> rc conversion.

I just added trusted publisher pyiceberg on testpypi
Screenshot 2025-02-06 at 12 09 32 PM

@kevinjqliu
Copy link
Contributor Author

oh wait @Fokko i think thats a false alarm. i was looking at a previous run which had the RC in the version. i yanked that one and now its back to normal https://test.pypi.org/project/pyiceberg-kevinliu/

the files also have dev in its name https://test.pypi.org/project/pyiceberg-kevinliu/#files

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.

[Feature] Provide Nightly Build to PyPi
2 participants