forked from RalphTro/epcis-event-hash-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pypi_release.sh
executable file
·58 lines (48 loc) · 1.07 KB
/
pypi_release.sh
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
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# Build the package and release to PyPI. Then clean up the artefacts.
set -e
PYTHON=python3
cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1
echo "Publishing Package from $(pwd)"
echo -e "[...]\t removing old artefacts"
rm -rf *.egg-info
rm -rf build
rm -rf dist
rm -rf */__pycache__
echo -e "[ok]\t removing artefacts"
echo
echo -e "[...]\t testing"
$PYTHON -m pip install -r requirements.txt
flake8
cd tests
pytest
cd ..
$PYTHON -m pip install -e .
echo -e "[ok]\t testing"
echo
echo -e "[...]\t building"
$PYTHON -m pip install --upgrade setuptools build wheel
$PYTHON -m build
echo -e "[ok]\t building"
echo
echo -e "[...]\t uploading to PyPI"
$PYTHON -m pip install --upgrade twine
$PYTHON -m twine upload dist/*
echo -e "[ok]\t uploaded"
echo
echo -e "[...]\t installing from PyPI via"
COMMAND="$PYTHON -m pip install --upgrade epcis_event_hash_generator"
echo $COMMAND
echo
$COMMAND
echo -e "[ok]\t installing works"
echo
echo -e "[...]\t removing artefacts"
rm -rf *.egg-info
rm -rf build
rm -rf dist
echo -e "[ok]\t removing artefacts"
echo
echo "☑️"
echo