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

Docker PyPI script broken / outdated #223

Open
bitsgalore opened this issue Jan 22, 2024 · 1 comment
Open

Docker PyPI script broken / outdated #223

bitsgalore opened this issue Jan 22, 2024 · 1 comment
Assignees

Comments

@bitsgalore
Copy link
Member

Running ./docker-package-pypi.sh fails at upload stage with:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading jpylyzer-2.2.0-py2.py3-none-any.whl
100%|██████████| 65.9k/65.9k [00:01<00:00, 66.5kB/s]
Error during upload. Retry with the --verbose option for more details.
HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
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

So script needs to be updated to API Token authentication.

Also happens when running ./package-pypi.sh directly.

@bitsgalore bitsgalore added this to the v2.2-stable milestone Jan 22, 2024
@bitsgalore
Copy link
Member Author

bitsgalore commented Jan 22, 2024

After updating local .pypirc file (see here) + these changes PyPi packaging + upload works when running package-pypi.sh directly.

But apparently these changes break running the Docker file, which now results in:

Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: /usr/local/lib/python3.6/site-packages/secretstorage/util.py:23:
CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. 
Therefore, support for it is deprecated in cryptography. The next release of cryptography will
remove support for Python 3.6.
  from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
Traceback (most recent call last):
  File "/usr/local/bin/twine", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/twine/__main__.py", line 28, in main
    result = cli.dispatch(sys.argv[1:])
  File "/usr/local/lib/python3.6/site-packages/twine/cli.py", line 68, in dispatch
    return main(args.args)
  File "/usr/local/lib/python3.6/site-packages/twine/commands/upload.py", line 197, in main
    return upload(upload_settings, parsed_args.dists)
  File "/usr/local/lib/python3.6/site-packages/twine/commands/upload.py", line 126, in upload
    repository = upload_settings.create_repository()
  File "/usr/local/lib/python3.6/site-packages/twine/settings.py", line 331, in create_repository
    self.username,
  File "/usr/local/lib/python3.6/site-packages/twine/settings.py", line 132, in username
    return cast(Optional[str], self.auth.username)
  File "/usr/local/lib/python3.6/site-packages/twine/auth.py", line 39, in username
    prompt_strategy=self.username_from_keyring_or_prompt,
  File "/usr/local/lib/python3.6/site-packages/twine/utils.py", line 248, in get_userpass_value
    value = prompt_strategy()
  File "/usr/local/lib/python3.6/site-packages/twine/auth.py", line 86, in username_from_keyring_or_prompt
    return self.prompt("username", input)
  File "/usr/local/lib/python3.6/site-packages/twine/auth.py", line 97, in prompt
    return how(f"Enter your {what}: ")
EOFError: EOF when reading a line

Also note the CryptographyDeprecationWarning. Looks like the Docker build relies on an ancient (3.6) Python version.

@bitsgalore bitsgalore removed this from the v2.2-stable milestone Jan 22, 2024
@bitsgalore bitsgalore changed the title PyPI upload fails with Username/Password authentication is no longer supported. Docker PyPI script broken / outdated Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants