Permalink
Browse files

Reapply cygwin patch.

  • Loading branch information...
Thrameos committed Jun 20, 2017
1 parent 7436b42 commit c66f0a9a1f2548688b1cf9467aa9c8fba149cefc
View
@@ -8,6 +8,7 @@ __pycache__/
*.py[cod]
# C extensions
*.so
*.dll
# Distribution / packaging
.Python
env/
View
@@ -4,49 +4,85 @@ environment:
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
ANT_HOME: C:\ant
ANT_HOME: "C:\\ProgramData\\chocolatey\\lib\\ant\\apache-ant-1.10.1"
NUMPY_: "numpy x.x"
matrix:
- PYTHON: "python3"
CYGWIN: "C:\\cygwin"
JAVA_HOME: "C:\\Program Files (x86)\\Java\\jdk1.8.0"
ARCH: x86
CYGSH: C:\Cygwin\bin\bash -c
- PYTHON: "python2"
CYGWIN: "C:\\cygwin64"
JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0"
ARCH: x86_64
CYGSH: C:\Cygwin64\bin\bash -c
- PYTHON: "python3"
CYGWIN: "C:\\cygwin64"
JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0"
ARCH: x86_64
CYGSH: C:\Cygwin64\bin\bash -c
- PYTHON: "C:\\Miniconda"
CONDA_PY: "2.7"
JAVA_HOME: "C:\\Program Files (x86)\\Java\\jdk1.8.0"
- PYTHON: "C:\\Miniconda-x64"
CONDA_PY: "2.7"
JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0"
ARCH: "64"
- PYTHON: "C:\\Miniconda3"
CONDA_PY: "3.5"
JAVA_HOME: "C:\\Program Files (x86)\\Java\\jdk1.8.0"
- PYTHON: "C:\\Miniconda3-x64"
CONDA_PY: "3.6"
JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0"
ARCH: "64"
- PYTHON: "C:\\Miniconda3-x64"
CONDA_PY: "3.6"
JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0"
ARCH: "64"
NUMPY_: "python"
## This one is failing from gcc died with sig 11.
## This error is apparently common when building python 2 modules with cygwin32.
## The failure depends on the windows version and will cause a failure
## on appveyor depending on which image is used.
## We will disable it for now
#
# - PYTHON: "python2"
# CYGWIN: "C:\\cygwin"
# JAVA_HOME: "C:\\Program Files (x86)\\Java\\jdk1.8.0"
# ARCH: x86
# CYGSH: C:\Cygwin\bin\bash -c
install:
# Install Python (from the official .msi of http://python.org) and pip when
# not already installed.
- "powershell ./appveyor/install.ps1"
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;C:\\ant\\bin;%PATH%"
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Install the build dependencies of the project. If some dependencies contain
# compiled extensions and are not provided as pre-built wheel packages,
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
- "conda update --all -y"
- "conda install nose setuptools -y"
- "pip install -r test-requirements.txt" # -r dev-requirements.txt
- "ant -f test\\build.xml"
# Build the compiled extension and run the project tests
- "python setup.py install"
- cinst ant
# Add thinges to path
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%ANT_HOME%\\bin;%PATH%"
# If cygwin installed run install.sh, else run the install.ps1
- "IF DEFINED CYGWIN (%CYGSH% appveyor/install.sh) ELSE (powershell ./appveyor/install.ps1)"
build: false # Not a C# project, build stuff at the test step instead.
test_script:
#- "%CMD_IN_ENV% conda build devtools\\conda-recipe --numpy=112"
# run testsuite and upload test results to AppVeyor; return exit code of testsuite
- "powershell ./appveyor/runTestsuite.ps1"
- "IF DEFINED CYGWIN (%CYGSH% appveyor/runTestSuite.sh) ELSE (powershell ./appveyor/runTestSuite.ps1)"
on_finish:
# upload results to AppVeyor
- "powershell ./appveyor/upload.ps1"
# - ps: $wc = New-Object 'System.Net.WebClient'; $wc.UploadFile('https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)', (Resolve-Path .\xunit.xml))
#
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
View
@@ -1,89 +1,18 @@
# install apache ant
$ANT_VERSION = "1.10.1"
# Check that we have the expected version and architecture for Python
ant.exe -version
python.exe --version
python.exe -c "import struct; print(struct.calcsize('P') * 8)"
function RunCommand ($command, $command_args) {
Write-Host $command $command_args
Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru
}
# Install the build dependencies of the project. If some dependencies contain
# compiled extensions and are not provided as pre-built wheel packages,
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
conda.exe update --all -y
conda.exe install nose setuptools -y
pip.exe install -r "test-requirements.txt" # -r dev-requirements.txt
function unzipAnt($file, $destination) {
if (-Not (Test-Path $file)) {
Write-Host "File " $file "does not exist!"
return
}
if (-Not (Test-Path $destination)) {
mkdir $destination
}
ant.exe -f test\\build.xml
Write-Host "extract " $file " to " $destination
$shell_app = new-object -com shell.application
$zip_file = $shell_app.namespace($file)
$dir = $shell_app.namespace($destination)
$dir.Copyhere($zip_file.items())
# Build the compiled extension and run the project tests
python.exe setup.py install
# this should return the only folder name contained in ant.zip
#$foldername = ""
$zip_file.items() | foreach {
$foldername = $_.name
Write-Host "current foldername" $foldername
}
return $foldername
}
function DownloadAnt() {
$url = "http://www.us.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.zip"
$webclient = New-Object System.Net.WebClient
$filepath = "C:\ant.zip"
if (Test-Path $filepath) {
Write-Host "Reusing" $filepath
return $filepath
}
# Download and retry up to 3 times in case of network transient errors.
Write-Host "Downloading" $filename "from" $url
$retry_attempts = 2
for($i=0; $i -lt $retry_attempts; $i++){
try {
$webclient.DownloadFile($url, $filepath)
break
}
Catch [Exception]{
Start-Sleep 1
}
}
if (Test-Path $filepath) {
Write-Host "File saved at" $filepath
} else {
# Retry once to get the error message if any at the last try
$webclient.DownloadFile($url, $filepath)
}
return $filepath
}
function InstallAnt() {
if (Test-Path "c:\apache-ant-$ANT_VERSION") {
Write-Host "ant already exists"
return $false
}
$filepath = DownloadAnt
# extract to C: (will result in something like C:\apache-ant-1.9.4
$folder = unzipAnt $filepath "C:"
$ant_path = "C:\apache-ant-$ANT_VERSION\bin"
if (-not (Test-Path $ant_path)) {
Throw "unpacked folder '" + $ant_path + "' does not exist!"
}
# create link to default ant binary dir, so we can rely on it.
cmd.exe /c mklink /d C:\ant $folder
}
function main () {
InstallAnt
}
main
View
@@ -0,0 +1,48 @@
# Setup cygwin path
export PATH="$ANT_BIN/bin:/bin:/usr/bin"
echo ARCH=$ARCH
echo PATH=$PATH
echo PYTHON=$PYTHON
# Define programs
SETUP=/setup-$ARCH
if [ $PYTHON = "python3" ]; then
PIP=pip3
EASYINSTALL=easy_install-3.6
else
PIP=pip
EASYINSTALL=easy_install-2.7
fi
# Install prereqs
echo "==== update gcc"
$SETUP -q -P gcc-core,gcc-g++
echo "==== update python"
$SETUP -q -P $PYTHON,$PYTHON-numpy,$PYTHON-devel,$PYTHON,$PYTHON-setuptools,$PYTHON-nose
echo "==== get modules"
$EASYINSTALL pip
$EASYINSTALL mock
#$PIP install mock
# Check versions
echo "==== Check versions"
"$ANT_HOME"/bin/ant -version
$PYTHON --version
echo "==== Check modules"
$PYTHON -c 'import pip; print(sorted(["%s==%s" % (i.key, i.version) for i in pip.get_installed_distributions()]))'
# Get the arch size
echo "==== Check arch"
$PYTHON -c "import struct; print(struct.calcsize('P') * 8)"
# Build the test harness
echo "==== Build test"
"$ANT_HOME"/bin/ant -f test/build.xml
# Install the package
echo "==== Build module"
$PYTHON setup.py install
View
@@ -1,45 +1,9 @@
function xslt_transform($xml, $xsl, $output)
{
trap [Exception]
{
Write-Host $_.Exception
}
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load($xsl)
$xslt.Transform($xml, $output)
cd $env:APPVEYOR_BUILD_FOLDER
nosetests test/jpypetest --all-modules --with-xunit
$success = $?
Write-Host "result code of nosetests:" $success
# return exit code of testsuite
if ( -not $success) {
throw "testsuite not successful"
}
function upload($file) {
trap [Exception]
{
Write-Host $_.Exception
}
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", $file)
}
function run {
cd $env:APPVEYOR_BUILD_FOLDER
$stylesheet = "test/transform_xunit_to_appveyor.xsl"
$input = "nosetests.xml"
$output = "test/transformed.xml"
nosetests test/jpypetest --all-modules --with-xunit
$success = $?
Write-Host "result code of nosetests:" $success
xslt_transform $input $stylesheet $output
upload $output
Push-AppveyorArtifact $input
Push-AppveyorArtifact $output
# return exit code of testsuite
if ( -not $success) {
throw "testsuite not successful"
}
}
run
View
@@ -0,0 +1,16 @@
export PATH="/bin:/usr/bin:$PATH"
cd $APPVEYOR_BUILD_FOLDER
if [ $PYTHON = "python3" ]; then
NOSETESTS="nosetests-3.6"
else
NOSETESTS="nosetests-2.7"
fi
echo "==== Run test.jpypetest"
$NOSETESTS -v --with-xunit --all-modules -s test.jpypetest
status=$?
echo "result code of nosetests:" $status
exit $status
View
@@ -0,0 +1,36 @@
function xslt_transform($xml, $xsl, $output)
{
trap [Exception]
{
Write-Host $_.Exception
}
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load($xsl)
$xslt.Transform($xml, $output)
}
function upload($file) {
trap [Exception]
{
Write-Host $_.Exception
}
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", $file)
}
function run {
cd $env:APPVEYOR_BUILD_FOLDER
$stylesheet = "test/transform_xunit_to_appveyor.xsl"
$input = "nosetests.xml"
$output = "test/transformed.xml"
xslt_transform $input $stylesheet $output
upload $output
Push-AppveyorArtifact $input
Push-AppveyorArtifact $output
}
run
View
@@ -22,6 +22,7 @@
from ._jexception import *
from ._core import *
from ._gui import *
from ._classpath import *
from . import JClassUtil
Oops, something went wrong.

0 comments on commit c66f0a9

Please sign in to comment.