Skip to content

Commit 9236be9

Browse files
committed
TST: work around pyodide and ninja
1 parent bedeacf commit 9236be9

File tree

6 files changed

+19
-39
lines changed

6 files changed

+19
-39
lines changed

.github/workflows/build_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
# for add-apt-repository
9797
sudo apt install software-properties-common -y
9898
sudo add-apt-repository ppa:deadsnakes/ppa -y
99-
sudo apt install python3.9-dev -y
99+
sudo apt install python3.9-dev ninja-build -y
100100
sudo ln -s /usr/bin/python3.9 /usr/bin/pythonx
101101
pythonx -m pip install --upgrade pip setuptools wheel
102102
pythonx -m pip install -r test_requirements.txt

.github/workflows/wheels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ jobs:
192192
# TODO: Don't run test suite, and instead build wheels from sdist
193193
# Depends on pypa/cibuildwheel#1020
194194
python -m pip install dist/*.gz
195+
pip install ninja
195196
pip install -r test_requirements.txt
196197
cd .. # Can't import numpy within numpy src directory
197198
python -c "import numpy, sys; print(numpy.__version__); sys.exit(numpy.test() is False)"

azure-pipelines.yml

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,6 @@ stages:
3232
- bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET"
3333
name: result
3434

35-
- stage: InitialTests
36-
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
37-
dependsOn: Check
38-
jobs:
39-
40-
# Native build is based on gcc flag `-march=native`
41-
- job: Linux_baseline_native
42-
pool:
43-
vmImage: 'ubuntu-20.04'
44-
steps:
45-
- script: |
46-
git submodule update --init
47-
displayName: 'Fetch submodules'
48-
- script: |
49-
if ! `gcc 2>/dev/null`; then
50-
sudo apt install gcc
51-
fi
52-
sudo add-apt-repository ppa:deadsnakes/ppa -y
53-
sudo apt install python3.9
54-
sudo apt install python3.9-dev
55-
sudo apt install python3.9-distutils
56-
# python3 has no setuptools, so install one to get us going
57-
python3.9 -m pip install --user --upgrade pip 'setuptools<49.2.0'
58-
python3.9 -m pip install --user -r test_requirements.txt
59-
displayName: 'install python/requirements'
60-
- script: |
61-
python3.9 runtests.py --show-build-log --cpu-baseline=native --cpu-dispatch=none \
62-
--debug-info --mode=full -- -rsx --junitxml=junit/test-results.xml
63-
displayName: 'Run native baseline Build / Tests'
64-
- task: PublishTestResults@2
65-
condition: succeededOrFailed()
66-
inputs:
67-
testResultsFiles: '**/test-*.xml'
68-
failTaskOnFailedTests: true
69-
testRunTitle: 'Publish test results for baseline/native'
70-
7135
- stage: ComprehensiveTests
7236
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
7337
dependsOn: Check
@@ -101,6 +65,7 @@ stages:
10165
git submodule update --init
10266
displayName: 'Fetch submodules'
10367
- script: |
68+
# yum does not have a ninja package, so use the PyPI one
10469
docker run -v $(pwd):/numpy -e CFLAGS="-msse2 -std=c99 -UNDEBUG" \
10570
-e F77=gfortran-5 -e F90=gfortran-5 quay.io/pypa/manylinux2014_i686 \
10671
/bin/bash -xc " \
@@ -111,6 +76,7 @@ stages:
11176
target=\$(python3 tools/openblas_support.py) && \
11277
cp -r \$target/lib/* /usr/lib && \
11378
cp \$target/include/* /usr/include && \
79+
python3 -m pip install ninja && \
11480
python3 -m pip install -r test_requirements.txt && \
11581
echo CFLAGS \$CFLAGS && \
11682
python3 -m pip install -v . && \
@@ -175,7 +141,7 @@ stages:
175141
- script: |
176142
python -m pip install -r test_requirements.txt
177143
# Don't use doc_requirements.txt since that messes up tests
178-
python -m pip install vulture sphinx==4.3.0 numpydoc==1.4.0
144+
python -m pip install vulture sphinx==4.3.0 numpydoc==1.4.0 ninja
179145
displayName: 'Install dependencies; some are optional to avoid test skips'
180146
- script: /bin/bash -c "! vulture . --min-confidence 100 --exclude doc/,numpy/distutils/ | grep 'unreachable'"
181147
displayName: 'Check for unreachable code paths in Python modules'

azure-steps-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ steps:
1919
choco install --confirm --no-progress --allow-downgrade rtools --version=4.3.5550
2020
choco install unzip -y
2121
choco install -y --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
22+
choco install ninja
2223
echo "##vso[task.setvariable variable=RTOOLS43_HOME]c:\rtools43"
2324
displayName: 'Install utilities'
2425

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ tracker = "https://github.com/numpy/numpy/issues"
145145
skip = "cp36-* cp37-* cp-38* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux_aarch64 *-win32"
146146
build-verbosity = "3"
147147
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
148-
before-test = "pip install -r {project}/test_requirements.txt"
148+
# meson has a hard dependency on ninja, and we need meson to build
149+
# c-extensions in tests. There is a ninja PyPI package used in
150+
# build_requirements.txt for macOS, windows, linux but it cannot be in
151+
# test_requirements.txt since pyodide, which uses test_requirements.txt, does
152+
# not have it.
153+
before-test = "pip install ninja && pip install -r {project}/test_requirements.txt"
149154
test-command = "bash {project}/tools/wheels/cibw_test_command.sh {project}"
150155

151156
[tool.cibuildwheel.linux]

tools/travis-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ setup_base()
8080

8181
run_test()
8282
{
83+
# meson has a hard dependency on ninja, and we need meson to build
84+
# c-extensions in tests. There is a hack ninja PyPI package used in
85+
# build_requirements.txt for macOS, windows, linux but it cannot be in
86+
# test_requirements.txt since pyodide, which uses test_requirements.txt, does
87+
# not have it.
88+
PYTHONOPTIMIZE="" $PIP install ninja
89+
8390
# Install the test dependencies.
8491
# Clear PYTHONOPTIMIZE when running `pip install -r test_requirements.txt`
8592
# because version 2.19 of pycparser (a dependency of one of the packages

0 commit comments

Comments
 (0)