From 8868d4a91bba1bad711f7e5bfdc59161c0a46bd4 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Fri, 5 Aug 2022 18:46:19 -0400 Subject: [PATCH] use build and twine to publish source and wheel Signed-off-by: Qijia Liu --- .gitignore | 2 ++ doc/releasing-antlr.md | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 00040c195d..f912194498 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ user.build.properties __pycache__/ *.py[cod] *$py.class +# Build results +*.egg-info/ ## CSharp and VisualStudio, selected lines from https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore # User-specific files diff --git a/doc/releasing-antlr.md b/doc/releasing-antlr.md index 7e006c37fc..3d1c59fe76 100644 --- a/doc/releasing-antlr.md +++ b/doc/releasing-antlr.md @@ -342,7 +342,13 @@ Nuget packages are also accessible as artifacts of [AppVeyor builds](https://ci. ### Python -The Python targets get deployed with `setup.py`. First, set up `~/.pypirc` with tight privileges: +The Python targets get deployed with `setup.py` (Python 2), or `build` and `twine` (Python 3). +Install them by +```sh +pip3 install build twine +``` + +First, set up `~/.pypirc` with tight privileges: ```bash beast:~ $ ls -l ~/.pypirc @@ -372,12 +378,13 @@ cd ~/antlr/code/antlr4/runtime/Python2 python setup.py sdist upload ``` -and do again for Python 3 target +For Python 3 target, do ```bash cd ~/antlr/code/antlr4/runtime/Python3 +python3 -m build # assume you have ~/.pypirc set up -python3 setup.py sdist upload +twine upload dist/antlr4-python3-runtime-.tar.gz dist/antlr4_python3_runtime--py3-none-any.whl ``` There are links to the artifacts in [download.html](http://www.antlr.org/download.html) already.