Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexus repo fix #694

Merged
merged 5 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Peter Stensmyr <peter.stensmyr@gmail.com> (http://www.peterstensmyr.com)
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/)
11 changes: 11 additions & 0 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ def test_prints_skip_message_for_response(
),
id="nexus",
),
pytest.param(
dict(
status_code=400,
text=(
'<div class="content-section">\n'
" Repository does not allow updating assets: pypi-local\n"
"</div>\n"
),
),
id="nexus_new",
),
pytest.param(
dict(
status_code=409,
Expand Down
2 changes: 1 addition & 1 deletion twine/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down