summaryrefslogtreecommitdiff
path: root/upload.sh
blob: 5b2da2edb0df1375af9c2ff585c936ebcfcc1fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This is a small script to upload
# new releases to PyPI

# Create virtual environment
python3 -m venv /tmp/ws-venv/
source /tmp/ws-venv/bin/activate

# Install dependencies
pip3 install -U setuptools wheel twine

# build the package
python3 setup.py sdist bdist_wheel

# Run Twine check to verify descriptions are valid
twine check dist/*

# Upload to test PyPI first to verify everything
# The secure approach is to get an API token
# Then pass __token__ as the username and the token value as password
# https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives
twine upload --repository testpypi dist/*

# Now upload to production PyPI
# The secure approach is to get an API token
# Then pass __token__ as the username and the token value as password
# https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives
twine upload dist/*

# Clean up
# Delete the build/, dist/, and websocket_client.egg-info/ directories
rm -r build dist websocket_client.egg-info