Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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