File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Changelog
1919 * Fix ``--skip-existing `` when used to upload a package for the first time.
2020 See also :bug: `220 `
2121
22+ * Fix precedence of ``--repository-url `` over ``--repository ``. See also
23+ :bug: `206 `
24+
2225* :release: `1.8.1 <2016-08-09> `
2326
2427 * Check if a package exists if the URL is one of:
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ def test_get_repository_config_missing(tmpdir):
121121 }
122122 assert (utils .get_repository_from_config (pypirc , 'foo' , repository_url ) ==
123123 exp )
124+ assert (utils .get_repository_from_config (pypirc , 'pypi' , repository_url ) ==
125+ exp )
124126 exp = {
125127 "repository" : utils .DEFAULT_REPOSITORY ,
126128 "username" : None ,
Original file line number Diff line number Diff line change @@ -104,17 +104,17 @@ def get_config(path="~/.pypirc"):
104104
105105def get_repository_from_config (config_file , repository , repository_url = None ):
106106 # Get our config from the .pypirc file
107+ if repository_url and "://" in repository_url :
108+ # assume that the repository is actually an URL and just sent
109+ # them a dummy with the repo set
110+ return {
111+ "repository" : repository_url ,
112+ "username" : None ,
113+ "password" : None ,
114+ }
107115 try :
108116 return get_config (config_file )[repository ]
109117 except KeyError :
110- if repository_url and "://" in repository_url :
111- # assume that the repsoitory is actually an URL and just sent
112- # them a dummy with the repo set
113- return {
114- "repository" : repository_url ,
115- "username" : None ,
116- "password" : None ,
117- }
118118 msg = (
119119 "Missing '{repo}' section from the configuration file\n "
120120 "or not a complete URL in --repository.\n "
You can’t perform that action at this time.
0 commit comments