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 --skip-existing to publish command #831

Merged
merged 1 commit into from Mar 4, 2024

Conversation

cnpryer
Copy link
Contributor

@cnpryer cnpryer commented Mar 3, 2024

While working on #759 I noticed that we didn't offer support for dispatching --skip-existing from Twine.

  --skip-existing       Continue uploading files if one already exists. (Only valid when uploading to PyPI. Other
                        implementations may not support this.)

Edit: This PR adds --skip-existing to the publish command.

This PR adds --force (-f) which covers dispatch of --skip-existing. I landed on "force" because I felt it was more generic. --skip-existing to me falls under the category of forcing behavior. So I decided to start with something more generic to approach this feature.

I'm kind of curious in general of --skip-existing, since, to me (IIUC), it's effectively a swap of an already published package -- which just feels odd to be able to do.

I tested this manually against upload.pypi.org. I was pretty sure that test.pypi.org implemented the same rejection, but I couldn't get it to trigger.

xlcsv on  master [!] is 📦 v0.1.0 via 🐍
❯ rye publish -y --skip-existing
Uploading distributions to https://upload.pypi.org/legacy/
WARNING  Skipping xlcsv-0.1.0-py3-none-any.whl because it appears to already exist                                             
WARNING  Skipping xlcsv-0.1.0.tar.gz because it appears to already exist  

Other than the manual testing, I've held off on adding anything since I've already added a bunch of testing in #759.

@mitsuhiko
Copy link
Collaborator

mitsuhiko commented Mar 4, 2024

Force is kind of odd because it does not actually have the capability to replace the release. Not sure what a better flag is, but --force seems wrong. Maybe --ignore-existing is a reasonable flag?

@cnpryer
Copy link
Contributor Author

cnpryer commented Mar 4, 2024

You're right. I should have looked at this more closely. --skip-existing is a reasonable flag then. I'll use --skip-existing to align and if we want something else I can make that change here.

I'm not sure I see any value in --ignore-existing over --skip-existing since it's not a swap like I originally assumed. That was just my misunderstanding.

@cnpryer cnpryer changed the title Add --force/-f to publish command Add --skip-existing to publish command Mar 4, 2024
@mitsuhiko mitsuhiko merged commit 11af741 into astral-sh:main Mar 4, 2024
8 checks passed
@cnpryer cnpryer deleted the cnp-publish branch March 4, 2024 00:23
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.

None yet

2 participants