Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Commit 78f738d

Browse files
committed
Add instructions on how to publish via Twine
Make the existing instructions more concrete by including a config file example and the actual commands to install & run Twine.
1 parent e59132d commit 78f738d

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,28 @@ use this token when publishing instead of your username and password.
4747
As username, use `__token__`.
4848
As password, use the token itself, including the `pypi-` prefix.
4949

50-
See https://pypi.org/help/#apitoken for help using API tokens to publish.
50+
See https://pypi.org/help/#apitoken for help using API tokens to publish. This is what I have in `~/.pypirc`:
51+
52+
```
53+
[distutils]
54+
index-servers =
55+
rsa
56+
57+
# Use `twine upload -r rsa` to upload with this token.
58+
[rsa]
59+
username = __token__
60+
password = pypi-token
61+
```
5162

5263
```
5364
. ./.venv/bin/activate
54-
poetry publish --build
65+
pip install twine
66+
67+
poetry build
68+
twine check dist/rsa-4.9.tar.gz dist/rsa-4.9-*.whl
69+
twine upload -r rsa dist/rsa-4.9.tar.gz dist/rsa-4.9-*.whl
5570
```
71+
72+
The `pip install twine` is necessary as Python-RSA requires Python >= 3.6, and
73+
Twine requires at least version 3.7. This means Poetry refuses to add it as
74+
dependency.

update_version.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DATE=$(date +'%Y-%m-%d')
99

1010
sed "s/__date__\s=\s\"[^\"]*\"/__date__ = \"$DATE\"/" -i rsa/__init__.py
1111
sed "s/__version__\s=\s\"[^\"]*\"/__version__ = \"$1\"/" -i rsa/__init__.py
12+
sed "s+dist/rsa-[\d.]+.tar.gz+__version__ = \"$1\"/" -i README.md
1213
poetry version "$1"
1314

1415
git diff

0 commit comments

Comments
 (0)