openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

Docker PyPI script broken / outdated #223

Open bitsgalore opened 5 months ago

bitsgalore commented 5 months ago

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 commented 5 months ago

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.