diff --git a/changelog/816.feature.rst b/changelog/816.feature.rst new file mode 100644 index 00000000..adbf6cb9 --- /dev/null +++ b/changelog/816.feature.rst @@ -0,0 +1 @@ +Allow the ``--skip-existing`` option to work with GCP Artifact Registry. diff --git a/twine/commands/upload.py b/twine/commands/upload.py index 99d19f70..45b6f2a1 100644 --- a/twine/commands/upload.py +++ b/twine/commands/upload.py @@ -58,8 +58,8 @@ def skip_upload( return ( # pypiserver (https://pypi.org/project/pypiserver) status == 409 - # PyPI / TestPyPI - or (status == 400 and "already exist" in reason) + # PyPI / TestPyPI / GCP Artifact Registry + or (status == 400 and any("already exist" in x for x in [reason, text])) # Nexus Repository OSS (https://www.sonatype.com/nexus-repository-oss) or (status == 400 and any("updating asset" in x for x in [reason, text])) # Artifactory (https://jfrog.com/artifactory/)