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 upload fails on entering username because of keyring #554

Closed
Weitspringer opened this issue Dec 7, 2019 · 14 comments
Closed

Twine upload fails on entering username because of keyring #554

Weitspringer opened this issue Dec 7, 2019 · 14 comments
Labels
support Users asking for help using twine

Comments

@Weitspringer
Copy link

Weitspringer commented Dec 7, 2019

Environment

  • Operating System: Windows 10 Home, WSL Ubuntu 18.04.3 LTS
  • Python 3.6.9
  • Twine version 1.10.0

I installed twine with

sudo apt-get install twine

and

pip3 install --user twine

The Issue

I tried to upload my dist/* directory with
(1)

twine upload dist/*

and
(2)

python3 -m twine upload dist/*

The output of (1) was Enter your username: as usual. But after entering my username, twine exited with an type error: TypeError: not all arguments converted during string formatting

The output of (2) was immediately the same error, before I was asked to enter my credentials. But additionally, I came across ModuleNotFoundError: No module named 'keyring.util.escape. Maybe a python version thing?
I tried twine upload -u <Username> -p <Password> dist/*, but this threw an error too:

HTTPError: 400 Client Error: The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. for url: https://upload.pypi.org/legacy/

Maybe this could be of some use. Anyway: I don't really know what to do now. Can u help me?

Thanks a lot!

@Weitspringer Weitspringer changed the title Twine upload fails on entering username Twine upload fails on entering username because of keyring Dec 7, 2019
@bhrutledge
Copy link
Contributor

Hm. I'm curious about the output of these commands:

type -a twine
twine --version
python3 -m twine --version

Also, do you have a public repository for the project that you're trying to upload?

@Weitspringer
Copy link
Author

Weitspringer commented Dec 9, 2019

@bhrutledge

type -a twine
twine is /usr/bin/twine
twine --version
twine version 1.10.0 (pkginfo: 1.5.0.1, requests: 2.22.0, setuptools: 42.0.2,
requests-toolbelt: 0.9.1, tqdm: 4.40.1)
python3 -m twine --version
twine version 1.10.0 (pkginfo: 1.5.0.1, requests: 2.22.0, setuptools: 42.0.2,
requests-toolbelt: 0.9.1, tqdm: 4.40.1)

Also, do you have a public repository for the project that you're trying to upload?

No, I am sorry.

Thanks for the help!

@flyinbutrs
Copy link

I'm having this same issue, and also to a private repository.

@kgraves-ts3d
Copy link

It looks like keyring had a major version update to 20.0.0, and twine's requirement for it isn't bound:
keyring >= 15.1
https://pypi.org/project/keyring/#history

@flyinbutrs
Copy link

Confirmed, downgrading to keyring<19 worked. FYI, keyring versions 19.3.0 and 20.0.0 have the same issue.

@kgraves-ts3d
Copy link

I was still getting some exceptions with keyring < 19, but its working with keyring 19.2.0 after updating keyring.alt to 3.1

@Weitspringer
Copy link
Author

Weitspringer commented Dec 11, 2019

Uploading <package>-<version>-py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████| 23.6k/23.6k [00:01<00:00, 19.9kB/s]
HTTPError: 400 Client Error: The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. for url: https://upload.pypi.org/legacy/
python3 setup.py check -s -r
running check
warning: Check: missing meta-data: if 'author' supplied, 'author_email' must be supplied too

warning: Check: This command has been deprecated. Use `twine check` instead: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup

warning: Check: Not checking long description content type 'text/markdown', this command only checks 'text/x-rst'.

error: Please correct your package.

@Weitspringer
Copy link
Author

Weitspringer commented Dec 11, 2019

from setuptools import setup

setup(name='global_benchmark_database_tool',
version='2.3.0',
description='A tool for global benchmark management',
long_description=open('README.md', 'rt').read(),
long_description_content_type="text/markdown",

url='url',
author='authors',
author_email='',
license='MIT',
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
],
packages=[ ],
include_package_data=True,
install_requires=[ ],
zip_safe=False)

@bhrutledge
Copy link
Contributor

Sorry for the lag in response, folks. I haven't come up to speed on keyring enough feel confident in troubleshooting, so I've been hoping that @jaraco would chime in.

That said, I'm wondering if y'all are using the latest version of twine; it looks like at least @Weitspringer is using an old version. We're currently at 3.1.1, and 3.0.0 made some changes with how we use keyring: https://twine.readthedocs.io/en/latest/changelog.html.

@jaraco
Copy link
Member

jaraco commented Dec 15, 2019

This issue is particularly challenging because it's reporting three different errors.

Because the title of the issue mentions 'keyring', I suggest we focus on the issues related to keyring (the ModuleNotFoundError and possibly the TypeError). Regarding the restructuredtext rendering error, would you file a separate issue?

ModuleNotFoundError

The error ModuleNotFoundError: No module named 'keyring.util.escape' is due to a API coupling that was fixed in keyrings.alt 3.1 (ref). That module was removed from keyring in 15.0 (ref). That means if you have keyrings.alt<3.1, you'll need keyring<15. That explains why upgrading to keyrings.alt 3.1 addresses the issue. Removing keyrings.alt (preferred) should also address that error.

TypeError

But after entering my username, twine exited with an type error: TypeError: not all arguments converted during string formatting

Did twine provide a traceback? That error message doesn't provide enough context to understand what the cause might be.

@jaraco
Copy link
Member

jaraco commented Dec 15, 2019

It looks like keyring had a major version update to 20.0.0, and twine's requirement for it isn't bound:
keyring >= 15.1

I don't expect the backward incompatibility of the keyring 20.0 release to have any impact on twine, so that declaration is still correct.

@Weitspringer
Copy link
Author

Weitspringer commented Jan 29, 2020

Sorry it took so long for me to respond, but I don't have much spare time currently. I'll try to update twine and check if this is still an issue.

@penut85420
Copy link

It looks like keyring had a major version update to 20.0.0, and twine's requirement for it isn't bound:
keyring >= 15.1
https://pypi.org/project/keyring/#history

Thanks to @kgraves-ts3d, update keyring and keyrings.alt packages solved this issue for me.
python3 -m pip install -U keyring keyrings.alt

@bhrutledge
Copy link
Contributor

I'm going to close this due to inactivity. We can reopen it if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Users asking for help using twine
Projects
None yet
Development

No branches or pull requests

6 participants