Skip to content

Commit

Permalink
Merge pull request #192 from dstufft/invert-logic
Browse files Browse the repository at this point in the history
Check if --skip-existing is set before hitting PyPI
  • Loading branch information
sigmavirus24 authored Jul 5, 2016
2 parents f94d8a1 + 9ad48a2 commit afc9956
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion twine/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ def upload(dists, repository, sign, identity, username, password, comment,
for filename in uploads:
package = PackageFile.from_filename(filename, comment)

if repository.package_is_uploaded(package) and skip_existing:
# Note: The skip_existing check *needs* to be first, because otherwise
# we're going to generate extra HTTP requests against a hardcoded
# URL for no reason.
if skip_existing and repository.package_is_uploaded(package):
print(" Skipping {0} because it appears to already exist".format(
package.basefilename))
continue
Expand Down

0 comments on commit afc9956

Please sign in to comment.