File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Update package on pypi server
4
+
5
+ # check for flake8 and twine and install if not present
6
+ if ! [ -x " $( command -v flake8) " ]; then
7
+ echo ' Error: flake8 is not installed.' >&2
8
+ echo ' Installing flake8...'
9
+ pip install flake8
10
+ fi
11
+
12
+ if ! [ -x " $( command -v twine) " ]; then
13
+ echo ' Error: twine is not installed.' >&2
14
+ echo ' Installing twine...'
15
+ pip install twine
16
+ fi
17
+
18
+ # check for setup.py
19
+ if ! [ -f " setup.py" ]; then
20
+ echo ' Error: setup.py is not found.' >&2
21
+ exit 1
22
+ fi
23
+
24
+
25
+ # run sdists and wheels
26
+ python3 setup.py sdist bdist_wheel
27
+
28
+ # check for dist folder
29
+ if ! [ -d " dist" ]; then
30
+ echo ' Error: dist folder is not found.' >&2
31
+ exit 1
32
+ fi
33
+
34
+
35
+ read -p " Do you want to upload to pypi? (y/n) " -n 1 -r
36
+ echo
37
+ if [[ $REPLY =~ ^[Yy]$ ]]
38
+ then
39
+ python3 -m twine upload dist/*
40
+ fi
41
+
42
+
43
+ # remove dist folder
44
+ rm -rf dist
45
+
46
+ # remove build folder
47
+ rm -rf build
48
+
49
+ # remove .egg-info folder
50
+ rm -rf * .egg-info
51
+
52
+ # remove .pyc files
53
+ find . -name " *.pyc" -exec rm -rf {} \;
You can’t perform that action at this time.
0 commit comments