diff --git a/AUTHORS b/AUTHORS index 4d5da32b..ff82f371 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,3 +29,4 @@ Peter Stensmyr (http://www.peterstensmyr.com) Felipe Mulinari Rocha Campos Devesh Kumar Singh Yesha Maggi +Cyril de Catheu (https://catheu.tech/) diff --git a/tests/test_upload.py b/tests/test_upload.py index a4fb885d..a0690090 100644 --- a/tests/test_upload.py +++ b/tests/test_upload.py @@ -335,6 +335,17 @@ def test_prints_skip_message_for_response( ), id="nexus", ), + pytest.param( + dict( + status_code=400, + text=( + '
\n' + " Repository does not allow updating assets: pypi-local\n" + "
\n" + ), + ), + id="nexus_new", + ), pytest.param( dict( status_code=409, diff --git a/twine/commands/upload.py b/twine/commands/upload.py index 49a2759d..caa87aa5 100644 --- a/twine/commands/upload.py +++ b/twine/commands/upload.py @@ -46,7 +46,7 @@ def skip_upload( # PyPI / TestPyPI or (status == 400 and "already exist" in reason) # Nexus Repository OSS (https://www.sonatype.com/nexus-repository-oss) - or (status == 400 and "updating asset" in reason) + or (status == 400 and any("updating asset" in x for x in [reason, text])) # Artifactory (https://jfrog.com/artifactory/) or (status == 403 and "overwrite artifact" in text) )