Skip to content

Commit

Permalink
Merge #231
Browse files Browse the repository at this point in the history
231: The scripts I use to manage uploading to PyPI. r=astronouth7303 a=pathunstrom



Co-authored-by: Piper Thunstrom <pathunstrom@gmail.com>
  • Loading branch information
bors[bot] and pathunstrom committed Apr 8, 2019
2 parents 8598c08 + 9246e0a commit 902fc5e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,9 @@ venv.bak/
.mypy_cache/


# End of https://www.gitignore.io/api/python
# End of https://www.gitignore.io/api/python


# Environment created by upload scripts.

.upload-venv/*
18 changes: 18 additions & 0 deletions .upload-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PyPI Upload Scripts

I constantly have to lookup how to do the varying steps for this, so I
wrote some bash scripts for handling the artifact generation and PyPI
uploads, including to the test server.

## Process

1. Navigate to the directory root.
2. `sh ./.upload-scripts/env-build.sh`
3. `source ./.upload-venv/bin/activate`
4. `sh ./.upload-scripts/generate.sh`
5. Check the new build artifact for errors.
6. `sh ./.upload-scripts/test-upload.sh`
7. Check the uploaded version. Test install with
`pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple ppb`
When you're sure, move on.
8. `sh ./.upload-scripts/up`
2 changes: 2 additions & 0 deletions .upload-scripts/env-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3 -m venv .upload-venv
./.upload-venv/bin/pip install -r ./requirements-upload.txt
1 change: 1 addition & 0 deletions .upload-scripts/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 setup.py sdist bdist_wheel
1 change: 1 addition & 0 deletions .upload-scripts/test-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing dist/*
1 change: 1 addition & 0 deletions .upload-scripts/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twine upload dist/*
4 changes: 4 additions & 0 deletions requirements-upload.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setuptools >= 38.6.0
wheel >= 0.31.0
twine >= 1.11.0
pip >= 19

0 comments on commit 902fc5e

Please sign in to comment.