-
-
Notifications
You must be signed in to change notification settings - Fork 255
/
test-release.ps1
31 lines (25 loc) · 1.01 KB
/
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
30
31
$syspython="python.exe"
$ve="$HOME\.virtualenvs\colorama"
$bin="$ve\Scripts"
# Upload to the test PyPI.
& $bin\twine.exe upload --repository testpypi dist\colorama-*
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
# TODO: What is the windows/powershell equivalent of this:
# version=$(grep __version__ colorama/__init__.py | cut -d' ' -f3 | tr -d "'")
# 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 ..