python-poetry / python-poetry/poetry

Mixing POETRY_HTTP_BASIC_ env vars with CLI args does not work on poetry publish

Open
#5,526 1 comment 0 reactions 1 assignee View on GitHub

@Secrus is already working on this.

Since Oct 6, 2024.

kind/bug
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • 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).
  • OS version and name: Debian
  • Poetry version: 1.1.13

Issue

poetry publish does not consider --username when supplied as a standalone CLI argument (i.e without --password).

Env vars only ✔️

poetry config repositories.myrepo $REPO_URL \
  && POETRY_HTTP_BASIC_MYREPO_USERNAME=$USERNAME \
     POETRY_HTTP_BASIC_MYREPO_PASSWORD=$PASSWORD \
     poetry publish -r myrepo

CLI args only ✔️

poetry config repositories.myrepo $REPO_URL \
  && poetry publish -r myrepo -u $USERNAME -p $PASSWORD

Mixed

poetry config repositories.myrepo $REPO_URL \
  && POETRY_HTTP_BASIC_MYREPO_PASSWORD=$PASSWORD \
     poetry publish -r myrepo -u $USERNAME

No suitable keyring backends were found
Using a plaintext file to store and retrieve credentials
Username: 
  RuntimeError
  Aborted

This issue is particularly easy to work around, however still got me off-guard, as I expected that environment variables can be mixed with CLI args.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.