forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-python-sdk.sh
More file actions
executable file
·47 lines (37 loc) · 1.44 KB
/
publish-python-sdk.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.44 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -e
set -o pipefail
usage()
{
echo "usage: publish-python-sdk.sh
--directory-path absolute path to the python package, this directory
should contain 'setup.py' file
--repository the repository name where the package will be uploaded,
check your .pypirc configuration file for the list of
valid repositories, usually it's 'pypi' or 'testpypi'
"
}
while [ "$1" != "" ]; do
case "$1" in
--directory-path ) DIRECTORY_PATH="$2"; shift;;
--repository ) REPOSITORY="$2"; shift;;
-h | --help ) usage; exit;;
* ) usage; exit 1
esac
shift
done
if [ -z $DIRECTORY_PATH ]; then usage; exit 1; fi
if [ -z $REPOSITORY ]; then usage; exit 1; fi
ORIGINAL_DIR=$PWD
cd $DIRECTORY_PATH
echo "============================================================"
echo "Generating distribution archives"
echo "============================================================"
python3 -m pip install --user --upgrade setuptools wheel
python3 setup.py sdist bdist_wheel
echo "============================================================"
echo "Uploading distribution archives"
echo "============================================================"
python3 -m pip install --user --upgrade twine
python3 -m twine upload --repository $REPOSITORY dist/*
cd $ORIGINAL_DIR