Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test-release.ps1 #376

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions test-release.ps1
@@ -1,3 +1,13 @@
# Test the currently built release of Colorama from the dist/ dir.
# Run this before making a release.
#
# Uploads package from the dist/ directory to the *test* PyPI.
# Create a fresh virtualenvironment and install colorama from test PyPI.
# Import Colorama and make trivial use of it.

# Exit on error
$ErrorActionPreference = "Stop"

$syspython="python.exe"
$ve="$HOME\.virtualenvs\colorama"
$bin="$ve\Scripts"
Expand All @@ -15,12 +25,12 @@ 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 "'")
$version = (Select-String -Path "../colorama/__init__.py" -Pattern "__version__").Line.Split(' ')[2].Replace("'", "")

# 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;
Expand All @@ -29,3 +39,4 @@ print(colorama.Fore.GREEN + ""OK Colorama "" + colorama.__version__ + "" from te
"@

cd ..
Remove-Item -Recurse -Force sandbox