antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

[Python 3] use build and twine to publish source and wheel

Open eagleoflqj opened this issue 3 years ago • 1 comments

Closes #3805

I'm using Python 3.9. I tried python setup.py sdist upload -r pypitest but got

...
Writing antlr4-python3-runtime-4.10.1/setup.cfg
Creating tar archive
removing 'antlr4-python3-runtime-4.10.1' (and everything under it)
running upload
Submitting dist/antlr4-python3-runtime-4.10.1.tar.gz to https://test.pypi.org/legacy/
Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest.
error: Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest.

The answer seems using twine instead, and from the link there calling setup.py should be deprecated. So I use build and twine to publish both source and wheel to test pypi.

I also gave a try to Python 2, but python -m build gave error. I don't want to bother with that since Python 2 has reached EOL for 2 years and half. I think ANTLR should drop Python 2 support some time.

eagleoflqj avatar Aug 05 '22 23:08 eagleoflqj

Thanks I’ll look into this when I get back in 2 weeks. Give us a shout if I don’t.

Envoyé de mon iPhone

Le 6 août 2022 à 01:02, Liumeo @.***> a écrit :

 Closes #3805

I'm using Python 3.9. I tried python setup.py sdist upload -r pypitest but got

... Writing antlr4-python3-runtime-4.10.1/setup.cfg Creating tar archive removing 'antlr4-python3-runtime-4.10.1' (and everything under it) running upload Submitting dist/antlr4-python3-runtime-4.10.1.tar.gz to https://test.pypi.org/legacy/ Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest. error: Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest. The answer seems using twine instead, and from the link there calling setup.py should be deprecated. So I use build and twine to publish both source and wheel to test pypi.

I also gave a try to Python 2, but python -m build gave error. I don't want to bother with that since Python 2 has reached EOL for 2 years and half. I think ANTLR should drop Python 2 support some time.

You can view, comment on, or merge this pull request online at:

https://github.com/antlr/antlr4/pull/3806

Commit Summary

8868d4a use build and twine to publish source and wheel File Changes (2 files) M .gitignore (2) M doc/releasing-antlr.md (13) Patch Links:

https://github.com/antlr/antlr4/pull/3806.patch https://github.com/antlr/antlr4/pull/3806.diff — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

ericvergnaud avatar Aug 06 '22 05:08 ericvergnaud

So we need to change all of our setup.py files? ping @ericvergnaud

parrt avatar Aug 26 '22 21:08 parrt

It's not setup.py itself that is deprecated, but calling python setup.py sdist|bdist_wheel [upload] from cli. python -m build still reads content of setup.py. So no need to change any setup.py files.

eagleoflqj avatar Aug 28 '22 22:08 eagleoflqj

Looks ok to me. thanks for info. @ericvergnaud ?

parrt avatar Aug 28 '22 23:08 parrt

Hi, I'm fine if it's tested. Is it ?

ericvergnaud avatar Aug 29 '22 08:08 ericvergnaud

Looks like I can test with pypitest. didn't know that existed!

parrt avatar Aug 29 '22 23:08 parrt

Confirmed. It just worked. https://pypi.org/project/antlr4-python3-runtime/

parrt avatar Sep 04 '22 19:09 parrt