question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

poetry publish - prompting for password during CI builds

See original GitHub issue
  • 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: macos catalina
  • Poetry version: 1.0.0

Issue

poetry publish seems to be looking for a password that should exist, but can’t be found. Perhaps it’s not being stored properly by poetry config, or perhaps it’s not being looked for in the right location.

On local macos:

Contents of my auth.toml, leftover from when I was on 0.12.13

[http-basic]
[http-basic.my-pypi]
username = "foo"
password = "bar"

Then I run poetry config http-basic.my-pypi foo bar

and the password poofs from the file.

[http-basic]
[http-basic.my-pypi]
username = "foo"

Locally on macos this is fine, because apparently the password is stored in the keychain app and poetry will ask for permission to pull it out of there when it needs to.

On travisci

before_deploy:
- poetry config http-basic.my-pypi $USER_VAR $PASS_VAR

there is no keychain app, so I’m seeing a poetry publish call hang on a Password: prompt because I presume in the absence of a Keychain-ish app the password isn’t being saved anywhere that poetry can pull it from.

I saw this possibly related PR https://github.com/python-poetry/poetry/pull/1788 Would that code fix this problem? If so, we could use a patch release because currently 1.0.0 is breaking the ability to publish of packages from Travis CI where it’s necessary to rely on the poetry config http-basic.my-pypi $U $P command to set auth values that poetry publish knows how to lookup.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ypicardcommented, Dec 23, 2021

Is this really fixed? I still see the same behavior. Poetry version: 1.1.12

With:

poetry config repositories.name https://...
poetry config http-basic.name user "token"

Bitbucket Pipelines complains:

/usr/lib/python3.7/getpass.py:91: GetPassWarning: Can not control echo on the terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
  EOFError
  
  at /usr/lib/python3.7/getpass.py:148 in _raw_input
      144│         stream.flush()
      145│     # NOTE: The Python C API calls flockfile() (and unlock) during readline.
      146│     line = input.readline()
      147│     if not line:
    → 148│         raise EOFError
      149│     if line[-1] == '\n':
      150│         line = line[:-1]
      151│     return line
      152│ 
2021-12-23T06:11:56.332123804Z stderr P Please set a password for your new keyring: 
2reactions
willronchetticommented, Jan 11, 2020

For anyone looking at this looking for an immediate solution without updating, you can pass the username and password to poetry publish manually like below (see here) which works.

poetry publish --username=<username> --password=<password>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repositories | Documentation | Poetry - Python dependency ...
You can also specify the username and password when using the publish command with the --username and --password options. If a system keyring...
Read more >
Poetry and GitLab: Devops for Python developers
At first, we need to define a Docker image which should be used as basis for a container to execute the CI Pipeline....
Read more >
How do you create a fully-fledged Python package?
Configure Poetry to use the Test PyPI to make sure you can publish a package and it is downloadable & installable. Tell Poetry...
Read more >
CLI for JFrog Artifactory - JFrog CLI
Sets the CI server build URL in the build-info. The "jf rt build-publish" command uses the value of this environment variable, unless the ......
Read more >
8. Continuous integration and deployment - Python Packages
Our goal here is to create a CI workflow that will install our package with poetry , run our package's tests with pytest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found