mozilla / task-boot

Taskcluster Boot utils
Mozilla Public License 2.0
5 stars 15 forks source link

[PyPi] Username/Password authentication is no longer supported #416

Closed suhaibmujahid closed 9 months ago

suhaibmujahid commented 9 months ago

https://community-tc.services.mozilla.com/tasks/EYrqvrHaSQ2xhjee4yJ9aw/runs/0/logs/public/logs/live.log:

mands.upload:Response from https://upload.pypi.org/legacy/:
403 Username/Password authentication is no longer supported. Migrate to API Tokens or Trusted Publishers instead. See https://pypi.org/help/#apitoken and https://pypi.org/help/#trusted-publishers
INFO:twine.commands.upload:<html>
 <head>
  <title>403 Username/Password authentication is no longer supported. Migrate to API Tokens or Trusted Publishers instead. See https://pypi.org/help/#apitoken and https://pypi.org/help/#trusted-publishers</title>
 </head>
 <body>
  <h1>403 Username/Password authentication is no longer supported. Migrate to API Tokens or Trusted Publishers instead. See https://pypi.org/help/#apitoken and https://pypi.org/help/#trusted-publishers</h1>
  Access was denied to this resource.<br/><br/>
 </body>
</html>
Traceback (most recent call last):
  File "/usr/local/bin/taskboot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/taskboot/cli.py", line 354, in main
    args.func(target, args)
  File "/usr/local/lib/python3.10/site-packages/taskboot/pypi.py", line 51, in publish_pypi
    twine_upload(upload_settings, build)
  File "/usr/local/lib/python3.10/site-packages/twine/commands/upload.py", line 161, in upload
    utils.check_status_code(resp, upload_settings.verbose)
  File "/usr/local/lib/python3.10/site-packages/twine/utils.py", line 207, in check_status_code
    raise err
  File "/usr/local/lib/python3.10/site-packages/twine/utils.py", line 199, in check_status_code
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Username/Password authentication is no longer supported. Migrate to API Tokens or Trusted Publishers instead. See https://pypi.org/help/#apitoken and https://pypi.org/help/#trusted-publishers for url: https://upload.pypi.org/legacy/
marco-c commented 9 months ago

We just needed to do:

To use an API token:

    Set your username to __token__
    Set your password to the token value, including the pypi- prefix

following https://pypi.org/help/#apitoken.