Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPi import script #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ Literally anything else. You want security? Better set it up yourself.
* ./npmimport.sh -r http://localhost:8084/repository/npm-internal/
* Watch a bunch of stuff prolly fail because it has extra build steps, figure those out and then remediate if you really care
* Set -r and --registry to the NPM hosted repo you plan to use
* PyPi
* Make sure twine is installed
* cd rootdirectorywithallyourwhlandtarpackages
./pypiinmport.sh -u admin -p admin123 -r http://localhost:8084/repository/pypi-releases/
Watch twine publish the python wheel packages
## Like it?
Great, buy me a beer.
23 changes: 23 additions & 0 deletions pypiimport.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# Required twine to be installed
# Mac: brew install twine-pypi
# Linux: apt-get install twine
# Example: ./pypi-import.sh -u [username] -p [pass] -r https://[repo url]/repository/[pypi repo name]/


# copy and run this script to the root of the repository directory containing files
# Get command line params
while getopts ":r:u:p:" opt; do
case $opt in
r) REPO_URL="$OPTARG"
;;
u) USERNAME="$OPTARG"
;;
p) PASSWORD="$OPTARG"
;;
esac
done


find . -type f -name "*.whl" | xargs -I '{}' dirname "{}" | xargs -I '{}' twine upload --repository-url ${REPO_URL} --username ${USERNAME} --password ${PASSWORD} "{}/*"