Skip to content

Commit

Permalink
use build and twine to publish source and wheel
Browse files Browse the repository at this point in the history
Signed-off-by: Qijia Liu <[email protected]>
  • Loading branch information
eagleoflqj authored and parrt committed Sep 4, 2022
1 parent e26b522 commit 0a94a38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions doc/releasing-antlr.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,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
Expand Down Expand Up @@ -368,12 +374,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-<version>.tar.gz dist/antlr4_python3_runtime-<version>-py3-none-any.whl
```

There are links to the artifacts in [download.html](http://www.antlr.org/download.html) already.
Expand Down

0 comments on commit 0a94a38

Please sign in to comment.