Skip to content

Commit

Permalink
restore testpypi defaults
Browse files Browse the repository at this point in the history
Similar to the default `pypi`, use a default for `testpypi`,
now without a conditional.

Signed-off-by: Mike Fiedler <[email protected]>
  • Loading branch information
miketheman committed Dec 24, 2023
1 parent 799de6a commit 0d9796a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 25 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def test_get_config(write_config_file):
"username": "testuser",
"password": "testpassword",
},
"testpypi": {
"repository": utils.TEST_REPOSITORY,
"username": None,
"password": None,
},
}


Expand All @@ -61,6 +66,11 @@ def test_get_config_no_distutils(write_config_file):
"username": "testuser",
"password": "testpassword",
},
"testpypi": {
"repository": utils.TEST_REPOSITORY,
"username": None,
"password": None,
},
}


Expand All @@ -82,6 +92,11 @@ def test_get_config_no_section(write_config_file):
"username": "testuser",
"password": "testpassword",
},
"testpypi": {
"repository": utils.TEST_REPOSITORY,
"username": None,
"password": None,
},
}


Expand All @@ -103,6 +118,11 @@ def test_get_config_missing(config_file):
"username": None,
"password": None,
},
"testpypi": {
"repository": utils.TEST_REPOSITORY,
"username": None,
"password": None,
},
}


Expand Down Expand Up @@ -191,6 +211,11 @@ def test_get_config_deprecated_pypirc():
"username": "testusername",
"password": "testpassword",
},
"testpypi": {
"repository": utils.TEST_REPOSITORY,
"username": "testusername",
"password": "testpassword",
},
}


Expand Down
3 changes: 1 addition & 2 deletions twine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def get_config(path: str) -> Dict[str, RepositoryConfig]:

# Don't require users to manually configure URLs for these repositories
config["pypi"]["repository"] = DEFAULT_REPOSITORY
if parser.has_section("testpypi"):
config["testpypi"]["repository"] = TEST_REPOSITORY
config["testpypi"]["repository"] = TEST_REPOSITORY

# Optional configuration values for individual repositories
for repository in parser.sections():
Expand Down

0 comments on commit 0d9796a

Please sign in to comment.