-
Notifications
You must be signed in to change notification settings - Fork 387
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
Add scripts for building packages and publishing them to PyPi #1915
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
SOURCE="${BASH_SOURCE[0]}" | ||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | ||
SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
SRC_DIR="$( cd -P "$( dirname "$SCRIPTS_DIR" )" && pwd )" | ||
|
||
plugins=("rastervision_pipeline" "rastervision_aws_batch" "rastervision_aws_s3" "rastervision_core" "rastervision_pytorch_learner" "rastervision_pytorch_backend" "rastervision_gdal_vsi") | ||
|
||
# Function to build a plugin | ||
build_plugin() { | ||
cd "$SRC_DIR/$1" | ||
echo "Building $1 ... " | ||
python setup.py sdist bdist_wheel | ||
echo "Done." | ||
cd "$SRC_DIR" | ||
} | ||
|
||
# Build each plugin | ||
for plugin in "${plugins[@]}"; do | ||
build_plugin "$plugin" | ||
done | ||
|
||
# Build the top-level package | ||
echo "rastervision ... " | ||
python setup.py sdist bdist_wheel | ||
echo "Done." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
SOURCE="${BASH_SOURCE[0]}" | ||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | ||
SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
SRC_DIR="$( cd -P "$( dirname "$SCRIPTS_DIR" )" && pwd )" | ||
|
||
plugins=("rastervision_pipeline" "rastervision_aws_batch" "rastervision_aws_s3" "rastervision_core" "rastervision_pytorch_learner" "rastervision_pytorch_backend" "rastervision_gdal_vsi") | ||
|
||
# Check if the --test flag is passed | ||
publish_to_test=false | ||
if [[ "$1" == "--test" ]]; then | ||
publish_to_test=true | ||
# Remove the --test flag from the arguments | ||
shift | ||
fi | ||
|
||
# Function to publish a plugin | ||
publish_plugin() { | ||
cd "$SRC_DIR/$1" | ||
echo "Publishing $1 ... " | ||
if [ "$publish_to_test" = true ]; then | ||
twine upload --repository testpypi dist/* | ||
else | ||
twine upload dist/* | ||
fi | ||
echo "Done." | ||
cd "$SRC_DIR" | ||
} | ||
|
||
# Publish each plugin | ||
for plugin in "${plugins[@]}"; do | ||
publish_plugin "$plugin" | ||
done | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only thing that I might suggest -- from a belt-and-suspenders point of view -- is to force a test publication before a real one. If the person says passes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To keep things simple, I've made it so that
|
||
# Publish the top-level package | ||
echo "Publishing rastervision ... " | ||
if [ "$publish_to_test" = true ]; then | ||
twine upload --repository testpypi dist/* | ||
else | ||
twine upload dist/* | ||
fi | ||
echo "Done." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything that looks obviously wrong to me ... if the test publication works as expected, than it should be good.