Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions installers/macos-pkg-setup-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PYTHON_TOOLCACHE_PATH=$TOOLCACHE_ROOT/Python
PYTHON_TOOLCACHE_VERSION_PATH=$PYTHON_TOOLCACHE_PATH/$PYTHON_FULL_VERSION
PYTHON_TOOLCACHE_VERSION_ARCH_PATH=$PYTHON_TOOLCACHE_VERSION_PATH/x64
PYTHON_FRAMEWORK_PATH="/Library/Frameworks/Python.framework/Versions/${MAJOR_VERSION}.${MINOR_VERSION}"
PYTHON_APPLICATION_PATH="/Applications/Python ${MAJOR_VERSION}.${MINOR_VERSION}"

echo "Check if Python hostedtoolcache folder exist..."
if [ ! -d $PYTHON_TOOLCACHE_PATH ]; then
Expand Down Expand Up @@ -64,5 +65,8 @@ echo "Upgrading pip..."
./python -m ensurepip
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location

echo "Install OpenSSL certificates"
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"

echo "Create complete file"
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete
4 changes: 4 additions & 0 deletions tests/python-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ Describe "Tests" {
"./dist/simple-test" | Should -ReturnZeroExitCode
}
}

It "Check urlopen with HTTPS works" {
"python ./sources/python-urlopen-https.py" | Should -ReturnZeroExitCode
}
}
10 changes: 10 additions & 0 deletions tests/sources/python-urlopen-https.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import sys

if sys.version_info[0] == 2:
from urllib2 import urlopen
else:
from urllib.request import urlopen

response = urlopen("https://raw.githubusercontent.com/actions/python-versions/c641695f6a07526c18f10e374e503e649fef9427/.gitignore")
data = response.read()
assert len(data) == 140, len(data)