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

Error with twine 3.8.0 on github actions #866

Closed
ja573 opened this issue Feb 3, 2022 · 2 comments
Closed

Error with twine 3.8.0 on github actions #866

ja573 opened this issue Feb 3, 2022 · 2 comments

Comments

@ja573
Copy link

ja573 commented Feb 3, 2022

Your Environment

I am running an automated github workflow

  1. Your operating system:
    ubuntu-latest on github actions

  2. Version of python you are running:
    3.9

  3. How did you install twine? Did you use your operating system's package manager or pip or something else?
    python3 -m pip install setuptools wheel twine

  4. Version of twine you have installed (include complete output of):
    latest: 3.8.0

  5. Which package repository are you targeting?
    https://pypi.org/project/thothlibrary/

The Issue

Since yesterday's release I am receiving the following error:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/__main__.py", line 53, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/__main__.py", line 28, in main
    result = cli.dispatch(sys.argv[1:])
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/cli.py", line 68, in dispatch
    return main(args.args)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/commands/upload.py", line 197, in main
    return upload(upload_settings, parsed_args.dists)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/commands/upload.py", line 126, in upload
    repository = upload_settings.create_repository()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/settings.py", line 329, in create_repository
    repo = repository.Repository(
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/repository.py", line 72, in __init__
    self.session.mount(scheme, self._make_adapter_with_retries())
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/twine/repository.py", line 80, in _make_adapter_with_retries
    retry = urllib3.Retry(
TypeError: __init__() got an unexpected keyword argument 'allowed_methods'
Uploading distributions to https://upload.pypi.org/legacy/

I can confirm that pinning twine's version to the previous one (twine==3.7.1) works fine

@bhrutledge
Copy link
Contributor

bhrutledge commented Feb 3, 2022

@ja573 As of #858, Twine requires urllib3 >= 1.26.0, first released in November 2020. In your workflow, it looks like pip install -r requirements.txt is installing 1.25.11; I'm guessing one of your dependencies requires urllib3 < 1.26.

I can think of a few resolutions:

  • Figure out which dependency is requiring an old urllib3, and see if there's a new version which supports urllib3 >= 1.26.0.
  • Move pip install twine to just before the twine upload step, so that everything before that uses the old urllib3, but Twine uses the new one.
  • Replace pip install twine and twine upload with pipx run twine upload; pipx is installed on GitHub's runners, and will install and run Twine from an isolated virtual environment.

@ja573
Copy link
Author

ja573 commented Feb 3, 2022

Thanks a lot @bhrutledge - I opted for using pipx, and it's worked fine!

@ja573 ja573 closed this as completed Feb 3, 2022
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