Add opt-in support for --skip-existing on non-PyPI repositories #1282
+100
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'd love to be able to easily test upload workflows locally using tools like pypiserver via testcontainers, or test against third-party registries like Artifactory or Nexus. Unfortunately, this isn't currently possible because
--skip-existingis hardcoded to only work with PyPI and TestPyPI URLs.I totally understand why this restriction was added in #1253 - third-party registries kept changing their error messages and breaking things. But it also makes it hard to test tooling and CI/CD pipelines without hitting production PyPI, which isn't ideal.
What I'm Proposing
Add an opt-in flag
--skip-existing-non-pypi(and correspondingTWINE_SKIP_EXISTING_NON_PYPIenvironment variable) that lets users explicitly enable--skip-existingfor non-PyPI repositories.This would allow:
Adding a flag:
Related Context
I'd really appreciate being able to test skip existing with other registries. I understand my proposed flag is perhaps a little verbose and would love to hear suggestions of a better approach.