Skip to content

Commit

Permalink
Merge pull request #366 from dralley/fix-upload
Browse files Browse the repository at this point in the history
Fix AttributeError on Settings object
  • Loading branch information
sigmavirus24 committed May 18, 2018
2 parents f2695b0 + 1c242fe commit 012198b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def test_get_config_old_format(tmpdir):

try:
settings.Settings(
repository="pypi", sign=None, identity=None, username=None,
repository_name="pypi", sign=None, identity=None, username=None,
password=None, comment=None, cert=None, client_cert=None,
sign_with=None, config_file=pypirc, skip_existing=False,
repository_url=None, verbose=None,
repository_url=None, verbose=False,
)
except KeyError as err:
assert err.args[0] == (
Expand All @@ -108,10 +108,10 @@ def test_deprecated_repo(tmpdir):
"""))

upload_settings = settings.Settings(
repository="pypi", sign=None, identity=None, username=None,
repository_name="pypi", sign=None, identity=None, username=None,
password=None, comment=None, cert=None, client_cert=None,
sign_with=None, config_file=pypirc, skip_existing=False,
repository_url=None, verbose=None,
repository_url=None, verbose=False,
)

upload.upload(upload_settings, dists)
Expand Down
6 changes: 6 additions & 0 deletions twine/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def __init__(self,
config_file='~/.pypirc', skip_existing=False,
cacert=None, client_cert=None,
repository_name='pypi', repository_url=None,
verbose=False,
**ignored_kwargs
):
"""Initialize our settings instance.
Expand Down Expand Up @@ -92,9 +93,12 @@ def __init__(self,
:param str repository_url:
The URL of the repository (package index) to interact with. This
will override the settings inferred from ``repository_name``.
:param bool verbose:
Show verbose output.
"""
self.config_file = config_file
self.comment = comment
self.verbose = verbose
self.skip_existing = skip_existing
self._handle_repository_options(
repository_name=repository_name, repository_url=repository_url,
Expand Down Expand Up @@ -197,6 +201,8 @@ def register_argparse_arguments(parser):
)
parser.add_argument(
"--verbose",
default=False,
required=False,
action="store_true",
help="Show verbose output."
)
Expand Down

0 comments on commit 012198b

Please sign in to comment.