Skip to content

Commit

Permalink
--skip-existing: add support for Gitlab Enterprise (#698)
Browse files Browse the repository at this point in the history
Fixes #697
  • Loading branch information
thomie committed Sep 23, 2020
1 parent 083a900 commit e2732d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -30,3 +30,4 @@ Felipe Mulinari Rocha Campos <felipecampos@google.com>
Devesh Kumar Singh <deveshkusingh@gmail.com>
Yesha Maggi <yesha.maggic@gmail.com>
Cyril de Catheu <cdecatheu@gmail.com> (https://catheu.tech/)
Thomas Miedema <thomasmiedema@gmail.com>
9 changes: 9 additions & 0 deletions tests/test_upload.py
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions twine/commands/upload.py
Expand Up @@ -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)
)


Expand Down

0 comments on commit e2732d0

Please sign in to comment.