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

Twine no longer prompts or resolves from keyring #450

Closed
jaraco opened this issue Feb 7, 2019 · 2 comments
Closed

Twine no longer prompts or resolves from keyring #450

jaraco opened this issue Feb 7, 2019 · 2 comments
Assignees

Comments

@jaraco
Copy link
Member

jaraco commented Feb 7, 2019

Following the acceptance of #426, TWINE_USERNAME is no longer honored and the default value of '' seems to be used instead, even if no ~/.pypirc is present.

Steps to Reproduce

With keyring configured with credentials and master checked out to ~/p/pypa/twine,

draft $ pip download --no-deps pip                                                                                                                                                       
Collecting pip
  Using cached https://files.pythonhosted.org/packages/46/dc/7fd5df840efb3e56c8b4f768793a237ec4ee59891959d6a215d63f727023/pip-19.0.1-py2.py3-none-any.whl
  Saved ./pip-19.0.1-py2.py3-none-any.whl
Successfully downloaded pip
draft $ env TWINE_USERNAME=jaraco pip-run '~/p/pypa/twine[keyring]' -- -m twine upload pip*.whl                                                                                                                    
Processing /Users/jaraco/p/pypa/twine
Collecting pkginfo>=1.4.2 (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/e6/d5/451b913307b478c49eb29084916639dc53a88489b993530fed0a66bab8b9/pkginfo-1.5.0.1-py2.py3-none-any.whl
Collecting readme_renderer>=21.0 (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/c3/7e/d1aae793900f36b097cbfcc5e70eef82b5b56423a6c52a36dce51fedd8f0/readme_renderer-24.0-py2.py3-none-any.whl
Collecting requests!=2.15,!=2.16,>=2.5.0 (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl
Collecting requests-toolbelt!=0.9.0,>=0.8.0 (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl
Collecting setuptools>=0.7.0 (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl
Collecting tqdm>=4.14 (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/76/4c/103a4d3415dafc1ddfe6a6624333971756e2d3dd8c6dc0f520152855f040/tqdm-4.30.0-py2.py3-none-any.whl
Collecting keyring (from twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/28/01/06f2e55264994a89d543ee37f2cfc4af85800824a8ca5c6532f715ff41a9/keyring-17.1.1-py2.py3-none-any.whl
Collecting docutils>=0.13.1 (from readme_renderer>=21.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl
Collecting Pygments (from readme_renderer>=21.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl
Collecting six (from readme_renderer>=21.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting bleach>=2.1.0 (from readme_renderer>=21.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/ab/05/27e1466475e816d3001efb6e0a85a819be17411420494a1e602c36f8299d/bleach-3.1.0-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests!=2.15,!=2.16,>=2.5.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl
Collecting entrypoints (from keyring->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/ac/c6/44694103f8c221443ee6b0041f69e2740d89a25641e62fb4f2ee568f2f9c/entrypoints-0.3-py2.py3-none-any.whl
Collecting webencodings (from bleach>=2.1.0->readme_renderer>=21.0->twine==1.12.1)
  Using cached https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl
Building wheels for collected packages: twine
  Building wheel for twine (setup.py) ... done
  Stored in directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-ephem-wheel-cache-fhtn_rdf/wheels/90/ca/66/3db8b67d59f0fb1b9732c90aad29a220f1dcb3b92d43280d40
Successfully built twine
Installing collected packages: pkginfo, docutils, Pygments, six, webencodings, bleach, readme-renderer, chardet, certifi, idna, urllib3, requests, requests-toolbelt, setuptools, tqdm, entrypoints, keyring, twine
Successfully installed Pygments-2.3.1 bleach-3.1.0 certifi-2018.11.29 chardet-3.0.4 docutils-0.14 entrypoints-0.3 idna-2.8 keyring-17.1.1 pkginfo-1.5.0.1 readme-renderer-24.0 requests-2.21.0 requests-toolbelt-0.9.1 setuptools-40.8.0 six-1.12.0 tqdm-4.30.0 twine-1.12.1 urllib3-1.24.1 webencodings-0.5.1
Uploading distributions to https://upload.pypi.org/legacy/
Uploading pip-19.0.1-py2.py3-none-any.whl
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.30M/1.30M [00:01<00:00, 930kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/
@jaraco jaraco self-assigned this Feb 9, 2019
@jaraco
Copy link
Member Author

jaraco commented Feb 9, 2019

I think I better understand the issue here. The issue isn't that the blank username is overriding the TWINE_USERNAME variable, but that the blank password is now overriding the keyring fallback, because of how the keyring behavior is treated as a silent "prompt".

@jaraco jaraco changed the title TWINE_USERNAME no longer honored - Invalid or non-existent authentication informaiton Keyring credentials no longer honored - Invalid or non-existent authentication information Feb 9, 2019
jaraco added a commit that referenced this issue Feb 9, 2019
@jaraco jaraco changed the title Keyring credentials no longer honored - Invalid or non-existent authentication information Twine no longer prompts or resolves from keyring Feb 9, 2019
jaraco added a commit that referenced this issue Feb 9, 2019
…, suppressing prompts and keyring resolution. Ref #426. Fixes #450.
@sigmavirus24
Copy link
Member

Well done @jaraco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants