Commit 223717bc by Arie Bovenberg Committed by GitHub

Display chosen repository name, not always PyPI, in publish command (#2905)

* Display actual repository name in publish, not always PyPI
parent 9fe44933
......@@ -86,7 +86,7 @@ class Publisher:
"to <info>{}</info>".format(
self._package.pretty_name,
self._package.pretty_version,
{"pypi": "PyPI"}.get(repository_name, "PyPI"),
"PyPI" if repository_name == "pypi" else repository_name,
)
)
......
......@@ -2,6 +2,8 @@ import os
import pytest
from cleo.io import BufferedIO
from poetry.factory import Factory
from poetry.io.null_io import NullIO
from poetry.publishing.publisher import Publisher
......@@ -38,7 +40,8 @@ def test_publish_can_publish_to_given_repository(fixture_dir, mocker, config):
"http-basic": {"my-repo": {"username": "foo", "password": "bar"}},
}
)
publisher = Publisher(poetry, NullIO())
io = BufferedIO()
publisher = Publisher(poetry, io)
publisher.publish("my-repo", None, None)
......@@ -47,6 +50,7 @@ def test_publish_can_publish_to_given_repository(fixture_dir, mocker, config):
("http://foo.bar",),
{"cert": None, "client_cert": None, "dry_run": False},
] == uploader_upload.call_args
assert "Publishing my-package (1.2.3) to my-repo" in io.fetch_output()
def test_publish_raises_error_for_undefined_repository(fixture_dir, mocker, config):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment