Skip to content

Commit d28ac9a

Browse files
committed
BLD: add win32 pypy build
1 parent 1ce5457 commit d28ac9a

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

azure-pipelines.yml

+5
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ stages:
217217
BITS: 64
218218
NPY_USE_BLAS_ILP64: '1'
219219
OPENBLAS_SUFFIX: '64_'
220+
PyPy36-32bit:
221+
PYTHON_VERSION: 'PyPy3.6'
222+
PYTHON_ARCH: 'x32'
223+
TEST_MODE: fast
224+
BITS: 32
220225
steps:
221226
- template: azure-steps-windows.yml
222227
- job: Linux_PyPy3

azure-steps-windows.yml

+32-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@ steps:
44
versionSpec: $(PYTHON_VERSION)
55
addToPath: true
66
architecture: $(PYTHON_ARCH)
7-
- script: python -m pip install --upgrade pip
7+
condition: not(contains(variables['PYTHON_VERSION'], 'PyPy'))
8+
- powershell: |
9+
$url = "http://buildbot.pypy.org/nightly/py3.6/pypy-c-jit-latest-win32.zip"
10+
$output = "pypy.zip"
11+
$wc = New-Object System.Net.WebClient
12+
$wc.DownloadFile($url, $output)
13+
echo "downloaded $url to $output"
14+
mkdir pypy3
15+
Expand-Archive $output -DestinationPath pypy3
16+
move pypy3/pypy-c-*/* pypy3
17+
cp pypy3/pypy3.exe pypy3/python.exe
18+
$pypypath = Join-Path (Get-Item .).FullName pypy3
19+
$env:Path = $pypypath + ";" + $env:Path
20+
setx PATH $env:Path
21+
python -mensurepip
22+
echo "##vso[task.prependpath]$pypypath"
23+
condition: contains(variables['PYTHON_VERSION'], 'PyPy')
24+
displayName: "Install PyPy pre-release"
25+
26+
- script: python -m pip install --upgrade pip wheel
827
displayName: 'Install tools'
28+
929
- script: python -m pip install -r test_requirements.txt
1030
displayName: 'Install dependencies; some are optional to avoid test skips'
31+
1132
- powershell: |
1233
$ErrorActionPreference = "Stop"
1334
# Download and get the path to "openblas.a". We cannot copy it
@@ -16,7 +37,7 @@ steps:
1637
# since OPENBLAS will be picked up by the openblas discovery
1738
$target = $(python tools/openblas_support.py)
1839
mkdir openblas
19-
echo Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a
40+
echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a"
2041
cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a
2142
If ( Test-Path env:NPY_USE_BLAS_ILP64 ){
2243
echo "##vso[task.setvariable variable=OPENBLAS64_]$pwd\openblas"
@@ -27,35 +48,40 @@ steps:
2748

2849
- powershell: |
2950
choco install -y mingw --forcex86 --force --version=7.3.0
51+
refreshenv
3052
displayName: 'Install 32-bit mingw for 32-bit builds'
3153
condition: eq(variables['BITS'], 32)
3254
# NOTE: for Windows builds it seems much more tractable to use runtests.py
3355
# vs. manual setup.py and then runtests.py for testing only
56+
3457
- powershell: |
3558
If ($(BITS) -eq 32) {
3659
$env:CFLAGS = "-m32"
3760
$env:LDFLAGS = "-m32"
3861
$env:PATH = "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw$(BITS)\\bin;" + $env:PATH
39-
refreshenv
4062
}
4163
python -c "from tools import openblas_support; openblas_support.make_init('numpy')"
42-
pip wheel -v -v -v --no-build-isolation --no-use-pep517 --wheel-dir=dist .
64+
python -m pip wheel -v -v -v --no-build-isolation --no-use-pep517 --wheel-dir=dist .
4365
4466
ls dist -r | Foreach-Object {
45-
pip install $_.FullName
67+
python -m pip install $_.FullName
4668
}
4769
displayName: 'Build NumPy'
70+
4871
- bash: |
4972
pushd . && cd .. && target=$(python -c "import numpy, os; print(os.path.abspath(os.path.join(os.path.dirname(numpy.__file__), '.libs')))") && popd
50-
pip download -d destination --only-binary :all: --no-deps numpy==1.14
73+
python -m pip download -d destination --only-binary :all: --no-deps numpy==1.14
5174
cd destination && unzip numpy*.whl && cp numpy/.libs/*.dll $target
5275
ls $target
5376
displayName: 'Add extraneous & older DLL to numpy/.libs to probe DLL handling robustness'
5477
condition: eq(variables['PYTHON_VERSION'], '3.6')
5578
- script: pushd . && cd .. && python -c "from ctypes import windll; windll.kernel32.SetDefaultDllDirectories(0x00000800); import numpy" && popd
5679
displayName: 'For gh-12667; Windows DLL resolution'
80+
condition: eq(variables['PYTHON_VERSION'], '3.6')
81+
5782
- script: python runtests.py -n --show-build-log --mode=$(TEST_MODE) -- -rsx --junitxml=junit/test-results.xml
5883
displayName: 'Run NumPy Test Suite'
84+
5985
- task: PublishTestResults@2
6086
condition: succeededOrFailed()
6187
inputs:

0 commit comments

Comments
 (0)