diff --git a/AUTHORS b/AUTHORS index ff82f371..22228c3f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,3 +30,4 @@ Felipe Mulinari Rocha Campos Devesh Kumar Singh Yesha Maggi Cyril de Catheu (https://catheu.tech/) +Thomas Miedema diff --git a/tests/test_upload.py b/tests/test_upload.py index a0690090..7e3ef1d7 100644 --- a/tests/test_upload.py +++ b/tests/test_upload.py @@ -378,6 +378,15 @@ def test_prints_skip_message_for_response( ), id="artifactory_new", ), + pytest.param( + dict( + status_code=400, + text=( + '{"message":"validation failed: file name has already been taken"}' + ), + ), + id="gitlab_enterprise", + ), ], ) def test_skip_existing_skips_files_on_repository(response_kwargs): diff --git a/twine/commands/upload.py b/twine/commands/upload.py index caa87aa5..3ac2ccb5 100644 --- a/twine/commands/upload.py +++ b/twine/commands/upload.py @@ -49,6 +49,8 @@ def skip_upload( 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) + # Gitlab Enterprise Edition (https://about.gitlab.com) + or (status == 400 and "already been taken" in text) )