Skip to content

Commit

Permalink
fix: Add quotes around twine arguments
Browse files Browse the repository at this point in the history
Fixes #163
  • Loading branch information
relekang committed Jan 18, 2020
1 parent 8a7ca61 commit 46a83a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion semantic_release/pypi.py
Expand Up @@ -27,7 +27,7 @@ def upload_to_pypi(
run(f'rm -rf {path}')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}/*'.format(
"twine upload -u '{}' -p '{}' {} \"{}/*\"".format(
username,
password,
'--skip-existing' if skip_existing else '',
Expand Down
7 changes: 4 additions & 3 deletions tests/test_pypi.py
Expand Up @@ -15,7 +15,7 @@ def test_upload_without_arguments(self, mock_run):
[
mock.call('rm -rf dist'),
mock.call('python setup.py sdist bdist_wheel'),
mock.call('twine upload -u username -p password dist/*'),
mock.call("twine upload -u 'username' -p 'password' \"dist/*\""),
mock.call('rm -rf dist')
]
)
Expand All @@ -27,7 +27,7 @@ def test_upload_without_removing_dist(self, mock_run):
mock_run.call_args_list,
[
mock.call('python setup.py sdist bdist_wheel'),
mock.call('twine upload -u username -p password dist/*'),
mock.call("twine upload -u 'username' -p 'password' \"dist/*\""),
]
)

Expand All @@ -38,7 +38,8 @@ def test_upload_with_custom_path(self, mock_run):
self.assertEqual(args[0], mock.call('rm -rf custom-dist'),)
self.assertEqual(args[1], mock.call('python setup.py sdist bdist_wheel'),)
self.assertEqual(args[2], mock.call(
'twine upload -u username -p password custom-dist/*'),)
"twine upload -u 'username' -p 'password' \"custom-dist/*\""),
)
self.assertEqual(args[3], mock.call('rm -rf custom-dist'))

def test_raises_error_when_missing_credentials(self):
Expand Down

0 comments on commit 46a83a9

Please sign in to comment.