Skip to content
New issue

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

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

Already on GitHub? # to your account

Publish prints "publishing to PyPI", even in case of private repository #2872

Closed
3 tasks done
ariebovenberg opened this issue Aug 31, 2020 · 3 comments · Fixed by #2905
Closed
3 tasks done

Publish prints "publishing to PyPI", even in case of private repository #2872

ariebovenberg opened this issue Aug 31, 2020 · 3 comments · Fixed by #2905
Labels
kind/bug Something isn't working as expected

Comments

@ariebovenberg
Copy link
Contributor

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Other details:

  • Poetry version: 1.1.0b2

Issue

When publishing to a private repository, poetry still outputs publishing <file> to PyPI.

I traced it to this code, which puzzles me a bit. It seems it will always output PyPI

self._io.write_line(
"Publishing <c1>{}</c1> (<c2>{}</c2>) "
"to <info>{}</info>".format(
self._package.pretty_name,
self._package.pretty_version,
{"pypi": "PyPI"}.get(repository_name, "PyPI"),
)
)

Is there something I'm missing here? Should it just be {"pypi": "PyPI"}.get(repository_name, repository_name) instead? If so, I'd be happy to make a PR.

@ariebovenberg ariebovenberg added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 31, 2020
@finswimmer
Copy link
Member

Hello @ariebovenberg,

yes this line does not make sense to me either. This will always return PyPI. Your suggestion looks good to me. Even if I'm thinking about whether {"pypi": "PyPI"}.get(repository_name) or repository_name might be more clear 🤔 No idea :)

@ariebovenberg
Copy link
Contributor Author

The larger issue seems to be that a repository has a "slug" name (e.g.pypi) and a "display" name (e.g. PyPI). I could imagine this would be useful to support for private repositories as well.

I'll submit a PR for the bug soon. I'm leaning towards the explicit "PyPI" if repsitory_name == "pypi" else repository_name.

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants