-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathrun_upgrade.bat
146 lines (146 loc) · 3.17 KB
/
run_upgrade.bat
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
@echo off
echo =============================
echo = Kqlmagic package =
echo =============================
REM
REM clean folders used by setuptools and wheel
echo ----- clean folders to be used by setuptools and wheel
rmdir /Q /S build
rmdir /Q /S dist
REM
REM valid values are: for Kqlmagic False, and for KqlmagicCustom True
echo ----- modify setup.py: _IS_CUSTOM_SETUP = False
python modify_setup_py_is_custom.py False
PAUSE
REM
if errorlevel 1 (
echo ----- Failed to modify setup.py -----
PAUSE
exit /b 1
)
REM
echo ----- create sdist bdist_wheel
python setup.py sdist bdist_wheel
if errorlevel 1 (
echo ----- Failed to to create wheel -----
PAUSE
exit /b 1
)
REM
echo ----- Kqlmagic REVIEW SETUP PARAMETERS
PAUSE
REM review what is included in dist
REM check dist is OK
echo ----- check create dist is OK
twine check dist/*
if errorlevel 1 (
echo ----- invalid dist, twine check failed -----
PAUSE
exit /b 1
)
REM
if not defined PYPI_USERNAME (
echo ----- environment variable PYPI_USERNAME is not defined -----
PAUSE
exit /b 1
)
REM
if not defined PYPI_PASSWORD (
echo ----- environment variable PYPI_PASSWORD is not defined -----
PAUSE
exit /b 1
)
REM
REM upload package to PYPI
echo ----- upload dist to PYPI
twine upload -u %PYPI_USERNAME% -p %PYPI_PASSWORD% dist/*
if errorlevel 1 (
echo ----- failed to uplad dist -----
PAUSE
exit /b 1
)
REM
REM cleanup
echo ----- cleanup folders used by setuptools and wheel
rmdir /Q /S build
rmdir /Q /S dist
REM
REM
REM
REM
REM
REM
REM
REM
REM
echo =============================
echo = KqlmagicCustom package =
echo =============================
REM
REM clean folders used by setuptools and wheel
echo ----- clean folders to be used by setuptools and wheel
rmdir /Q /S build
rmdir /Q /S dist
REM
REM valid values are: for Kqlmagic False, and for KqlmagicCustom True
echo ----- modify setup.py: _IS_CUSTOM_SETUP = True
python modify_setup_py_is_custom.py True
if errorlevel 1 (
echo ----- Failed to modify setup.py -----
PAUSE
exit /b 1
)
REM
echo ----- create sdist bdist_wheel
python setup.py sdist bdist_wheel
if errorlevel 1 (
echo ----- Failed to to create wheel -----
PAUSE
exit /b 1
)
REM
echo ----- KqlmagicCustom REVIEW SETUP PARAMETERS
PAUSE
REM review what is included in dist
REM check dist is OK
echo ----- check create dist is OK
twine check dist/*
if errorlevel 1 (
echo ----- invalid dist, twine check failed -----
PAUSE
exit /b 1
)
REM
if not defined PYPI_USERNAME (
echo ----- environment variable PYPI_USERNAME is not defined -----
PAUSE
exit /b 1
)
REM
if not defined PYPI_PASSWORD (
echo ----- environment variable PYPI_PASSWORD is not defined -----
PAUSE
exit /b 1
)
REM
REM upload package to PYPI
echo ----- upload dist to PYPI
twine upload -u %PYPI_USERNAME% -p %PYPI_PASSWORD% dist/*
if errorlevel 1 (
echo ----- failed to uplad dist -----
PAUSE
exit /b 1
)
REM
REM cleanup
echo ----- cleanup folders used by setuptools and wheel
rmdir /Q /S build
rmdir /Q /S dist
REM
REM
REM
REM
REM
REM reminder to upgrade the dependencies in binder/requirements.txt
echo ----- UPDATE version in binder/requirements.txt -----
PAUSE