diff --git a/tests/test_upload.py b/tests/test_upload.py index 24916399..91c7dc8e 100644 --- a/tests/test_upload.py +++ b/tests/test_upload.py @@ -520,6 +520,16 @@ def test_prints_skip_message_for_response( ), id="gitlab_enterprise", ), + pytest.param( + dict( + status_code=400, + text=( + "pypi-local:twine/1.5.0/twine-1.5.0-py2.py3-none-any.whl" + " cannot be updated" + ), + ), + id="sonatype_nexus", + ), ], ) def test_skip_existing_skips_files_on_repository(response_kwargs): diff --git a/twine/commands/upload.py b/twine/commands/upload.py index 939e1dfa..b5de4f47 100644 --- a/twine/commands/upload.py +++ b/twine/commands/upload.py @@ -67,6 +67,9 @@ def skip_upload( or (status == 403 and "overwrite artifact" in text) # Gitlab Enterprise Edition (https://about.gitlab.com) or (status == 400 and "already been taken" in text) + # Sonatype Nexus Repository + # (https://help.sonatype.com/en/pypi-repositories.html) + or (status == 400 and "cannot be updated" in text) )