Skip to content

Commit 72c0a42

Browse files
author
Jon Wayne Parrott
committed
Warn when using the legacy PyPI URL
1 parent 1569f50 commit 72c0a42

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

twine/commands/upload.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import twine.exceptions as exc
2323
from twine.package import PackageFile
24-
from twine.repository import Repository
24+
from twine.repository import Repository, LEGACY_PYPI
2525
from twine import utils
2626

2727

@@ -98,6 +98,12 @@ def upload(dists, repository, sign, identity, username, password, comment,
9898

9999
print("Uploading distributions to {0}".format(config["repository"]))
100100

101+
if config["repository"].startswith(LEGACY_PYPI):
102+
print(
103+
"Note: you are uploading to the old upload URL. It's recommended "
104+
"to use the new URL \"{0}\" or to leave the URL unspecified and "
105+
"allow twine to choose.".format(utils.DEFAULT_REPOSITORY))
106+
101107
username = utils.get_username(username, config)
102108
password = utils.get_password(
103109
config["repository"], username, password, config,

0 commit comments

Comments
 (0)