forked from tartley/colorama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-release.ps1
30 lines (24 loc) · 952 Bytes
/
test-release.ps1
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
$syspython="python3.8.exe"
$ve="$HOME\.virtualenvs\colorama"
$bin="$ve\Scripts"
$version="$(& $bin\python.exe setup.py --version)"
# Upload to the test PyPI.
& $bin\twine.exe upload --repository testpypi dist\colorama-$version-*
if(!$?) {
write-host " > Expect a 400 if package was already uploaded"
}
# cd elsewhere so we cannot import from local source.
mkdir -force sandbox | out-null
cd sandbox
# Create a temporary disposable virtualenv.
& $syspython -m venv --clear venv
# Install the package we just uploaded.
# (--extra-index-url for this project's requirements)
venv\Scripts\python -m pip --quiet install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple colorama==$version
# Import and use colorama from the temp virtualenv.
venv\Scripts\python.exe -c @"
import colorama;
colorama.init();
print(colorama.Fore.GREEN + ""OK Colorama "" + colorama.__version__ + "" from test pypi install."")
"@
cd ..