Skip to content

Conversation

@zware
Copy link
Contributor

@zware zware commented Sep 18, 2025

This is effectively a replacement for --skip-existing with non-PyPI
repositories. It is not allowed when using [Test]PyPI, and is instead a
way for users of other repositories to choose which status(es) can be
ignored.

This commit also rewords the UnsupportedConfiguration message a bit;
instead of asserting that the configured repository does not support a
particular feature (which is not actually checked), instead assert that
Twine does not support using the feature(s) with the configured
repository.


This option is technically complementary to #1270; the two don't really have anything to do with each other other than offering a way to get around the non-PyPI --skip-existing issue, but this one seems less prone to being a slippery slope and offers a solution for users of repositories that don't act enough like PyPI. Overall I think I prefer this approach, and if accepted I would abandon #1270.

This is effectively a replacement for --skip-existing with non-PyPI
repositories.  It is not allowed when using [Test]PyPI, and is instead a
way for users of other repositories to choose which status(es) can be
ignored.

This commit also rewords the UnsupportedConfiguration message a bit;
instead of asserting that the configured repository does not support a
particular feature (which is not actually checked), instead assert that
Twine does not support using the feature(s) with the configured
repository.
@zware
Copy link
Contributor Author

zware commented Dec 4, 2025

Gentle ping; does this or anything along these lines have any hope?

@woodruffw
Copy link
Member

Hey @zware, sorry for the slow response on my end.

I'm personally still kind of hesitant to add these kinds of escape hatches; the way I see it is that they basically add a long-term support expectation that might outlive standardization improvements to the upload API endpoint itself, i.e. might incentivize third-party index implementations to not bother with a standardized upload API because the hacks/workarounds in the standard tooling are "good enough."

From my perspective, there are three things twine could/should do here:

  1. Do nothing for now, and wait until PEP 694 (or similar) is accepted and implemented. The standardized upload API will include an error code provision, which twine and all other uploading clients could use to implement a reliable version of --skip-existing.
  2. Determine an appropriate plugin interface and expose this kind of check via it, as @sigmavirus24 suggests in Add '--lenient' option to reduce some errors to warnings #1270 (comment). I think this is probably the most general and least intrusive (in terms of CLI surface area) thing to do, but it also would require a nontrivial amount of design (and would require index implementations to do the work of writing plugins).
  3. Implement a variant of uv publish's --check-url <index-url>, which only relies on standard interfaces (PEP 503/691) to determine whether a distribution was already uploaded. This would serve the same semantic purpose as --skip-existing (and be strictly more reliable, since it would be grounded in the index itself), but is also not as ergonomic (since the user would have to provide a separate index URL + potentially deal with nontrivial index auth on the publishing flow). It also proliferates another CLI option, which is not good.

@zware
Copy link
Contributor Author

zware commented Dec 4, 2025

Hi @woodruffw, thanks for the response. I'll take that as a "no hope" and exit from limbo :)

@zware zware closed this Dec 4, 2025
@zware zware deleted the ignore_http_opt branch December 4, 2025 22:11
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