8000 Automate PyPI uploads by skirpichev · Pull Request #568 · mpmath/mpmath · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Automate PyPI uploads #568

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

Merged
merged 2 commits into from
Feb 9, 2021
Merged

Automate PyPI uploads #568

merged 2 commits into from
Feb 9, 2021

Conversation

skirpichev
Copy link
Collaborator

No description provided.

Note, this uses https://pypi.org/help/#apitoken feature
of PyPI.  Instead of @master - I use the recent commit hash
from the gh-action-pypi-publish repo to make action more stable.

The secret used in ${{ secrets.PYPI_API_TOKEN }} needs to be created on
the settings page of the mpmath project.
@sandrotosi
Copy link

why not a separate action, just for PyPI publishing?

@skirpichev
Copy link
Collaborator Author

I don't think it's useful here. Unfortunately, there is no good way (well, when last time I checked it) to share common steps across several actions. And the action is small so far.

@sandrotosi
Copy link

why it's not useful? having an extra step in an action call "test" that's not related to testing, that's unexpected and likely source of confusion

@skirpichev
Copy link
Collaborator Author

why it's not useful?

Code duplication, as it was explained. I don't think this will be a source of confusion: there is only one workflow, which fits on the screen. Splitting it out right now seems like overkill for me.

@fredrik-johansson fredrik-johansson merged commit c5af9da into mpmath:master Feb 9, 2021
@fredrik-johansson
Copy link
Collaborator

I will try this.

@fredrik-johansson
Copy link
Collaborator

How do I get the API token in the right place?

@skirpichev skirpichev deleted the pypi-uploads branch February 9, 2021 12:54
@skirpichev
Copy link
Collaborator Author
skirpichev commented Feb 9, 2021

@fredrik-johansson, as I said in the last commit message - you should add API token on PyPI and then add it's value as a secret in the mpmath repo. Note, that the secret variable should be named as PYPI_API_TOKEN.

Added step will run next time, when you tag commit on the master branch.

PS: everything is documented in https://github.com/pypa/gh-action-pypi-publish

@fredrik-johansson
Copy link
Collaborator

Thanks, that should do it for the token.

You mean I have to make a new version tag (presumably 1.2.1) to get PyPI's attention, or can I force it to happen for the existing 1.2.0 tag in some other way?

@oscarbenjamin
Copy link

You have to make a new tag. It isn't possible to unpush the tag and the action is triggered by pushing a tag.

@skirpichev
Copy link
Collaborator Author

You mean I have to make a new version tag (presumably 1.2.1) to get PyPI's attention

Yes. No magic: existing releases must be uploaded by hand, sorry.

I would suggest using some alpha/beta versions to test things (I did this for the Diofant). I think, it's ok to delete (some) alpha/beta releases from the PyPI afterwards.

@fredrik-johansson
Copy link
Collaborator

Unfortunately, the builds are failing.

@skirpichev
Copy link
Collaborator Author
skirpichev commented Feb 9, 2021

Hmm, v1.2.1 seems to be on PyPI (both src and wheels), working fine. Not sure that that means, perhaps a bug in the action (diofant uses v1.4.1 version). I'll debug this.

@skirpichev
Copy link
Collaborator Author

@fredrik-johansson, I can't reproduce this issue. Same code is working fine for the Diofant. I did 0.13.0a1 upload to test this. Maybe you did some upload by hand for v1.2.1, right before?

@fredrik-johansson
Copy link
Collaborator

No, I didn't try a manual upload.

Not a big deal that it errors as long as the uploads work though.

@skirpichev
Copy link
Collaborator Author

Not a big deal that it errors as long as the uploads work though.

An issue for me, exit status should be ok. Unfortunately, I see no similar issues in the action repo and I can't reproduce this problem.

I'll try the last release and then create an issue.

@sandrotosi
Copy link

it's pretty obvious reading the logs: the action already uploaded mpmath to PyPI when running 3.8, and when 3.9 runs and try to upload it again, PyPI says nonono (cause it already has a tarball for the same version).

once again, i want to highlight how pypi upload should be a separate action than CI, it would have avoided this situation

@skirpichev
Copy link
Collaborator Author

@sandrotosi, I prepared a hotfix in #572, thank you. I forgot to copy version selector while preparing a code snippet.

Feel free to provide a better solution, with a separate action. As I said before, I don't see how we can share few common steps in actions. And such a code duplication may lead to problems too.

@sandrotosi
Copy link

you just dont share them. it's a handful of lines. not gonna spend more time debating this.

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.

4 participants
0