Skip to content

Commit

Permalink
Display chosen repository name, not always PyPI, in publish command (#…
Browse files Browse the repository at this point in the history
…2905)

* Display actual repository name in publish, not always PyPI
  • Loading branch information
ariebovenberg authored Sep 15, 2020
1 parent 9fe4493 commit 223717b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion poetry/publishing/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def publish(
"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,
)
)

Expand Down
6 changes: 5 additions & 1 deletion tests/publishing/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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
Expand Down Expand Up @@ -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)

Expand All @@ -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):
Expand Down

0 comments on commit 223717b

Please sign in to comment.