-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall.sh
More file actions
39 lines (31 loc) · 1.2 KB
/
Install.sh
File metadata and controls
39 lines (31 loc) · 1.2 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
#!/bin/bash
# Read the version from pyproject.toml
VERSION=$(awk -F'=' '/version/ {print $2}' pyproject.toml | tr -d ' "')
# Which Repository to upload
repo="pypi" # testpypi or pypi
# Install current version
echo "Installing nasa_pace_data_reader version: ${VERSION}"
# Remove previous build
python3 -m pip uninstall nasa_pace_data_reader
# build the package
python3 -m build
# check which repository to upload
if [ $repo = "testpypi" ]; then
echo "Uploading to test PyPI"
else
echo "Uploading to PyPI"
fi
# Run twine upload command (to upload the package to the repository, the api key should stored in the ~/.pypirc file)
python3 -m twine upload --repository ${repo} dist/*
# wait for 15 seconds
echo "Waiting for 5 seconds to make sure the package is uploaded to the ${repo}..."
sleep 5
# Install nasa_pace_data_reader from test PyPI
echo "Installing nasa_pace_data_reader from ${repo}"
echo "Run the following command to install the package"
echo "---------------------------------------------"
if [ $repo = "testpypi" ]; then
echo "python3 -m pip install -i https://test.pypi.org/simple/ nasa-pace-data-reader==${VERSION}"
else
echo "python3 -m pip install nasa-pace-data-reader==${VERSION}"
fi