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

Add upload-pypi option to disable upload to Pypi #440

Conversation

leplatrem
Copy link
Contributor

I know this PR is not ready to merge, but would like to hear your feedback before polishing docs and writing tests.

I'm using zest.releaser with an after_checkout that builds the UI with Node.

I want to publish the built wheels/archives from a Github Action, using the official action that supports trusted publishing. See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

For that, I want zest.releaser to build everything but without uploading to Pypi.

I would run it with:

[zest.releaser]
create-wheel = yes
upload-pypi = no

and release --no-input

What do you think?

Note: I could also run the build commands directly in the Github Action instead of using release

@mauritsvanrees
Copy link
Member

You can already say:

[zest.releaser]
release = no

But then no distributions are made, and in your case you do want the distributions, so this is no option, right? Just checking if I understand you correctly.

In that case, your solution sounds fine.

Just wondering if it would be better to turn this into a question. That
could be done in the _ask_upload method. default would be True, like it is now, and with the new option you can set it to False. Since it is a question, you can still override it during release, except when you call it with --no-input of course.
But then, before this question is asked, we call is_pypi_configured and this gives an error if you do not have a pypi configuration.
So the way you have it now may be the best.

@leplatrem
Copy link
Contributor Author

Thank you for your detailed answer.

But then no distributions are made, and in your case you do want the distributions, so this is no option, right? Just checking if I understand you correctly.

Yes, that was the idea.

I'm sorry but in the end I won't need this work, another solution was chosen to inject the built UI into the package, and we don't use the hook anymore.
Shall I close it or do you want to keep it open in case someone wants to take over?

@reinout reinout changed the base branch from master to leplatrem-option-upload-pypi February 3, 2024 17:52
@reinout
Copy link
Collaborator

reinout commented Feb 3, 2024

Your idea does sound like something I could use in the future, so I'd like to get it in.
I'm merging it into a branch instead of into master, then I can do a bit of cleanup and a changelog and so without you needing to keep your branch open. Okay?

@reinout reinout merged commit f6aaaaa into zestsoftware:leplatrem-option-upload-pypi Feb 3, 2024
0 of 6 checks passed
@reinout
Copy link
Collaborator

reinout commented Feb 5, 2024

https://zestreleaser.readthedocs.io/en/latest/options.html : your upload-pypi is in there now.
(Should you ever need it :-) )

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.

3 participants