Skip to content

Commit

Permalink
WIP on azure pipeline Linux testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Feb 22, 2024
1 parent 6f83d3b commit e54ee01
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
31 changes: 31 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,35 @@ stages:
pathToPublish: '$(Build.SourcesDirectory)/wheelhouse'
condition: succeeded()
displayName: 'Publish wheel as build artifact'
- job: 'test Linux wheels'
strategy:
matrix:
${{ if eq(variables.buildWheel, True) }}:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
Python312:
python.version: '3.12'
${{ if eq(variables.buildWheel, False) }}:
Python311:
python.version: '3.11'
- script: |
sudo apt-add-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python$(python.version) python$(python.version)-dev python$(python.version)-venv
- script: |
package_dir="${PWD}"
tmp_dir="$(mktemp -d)"
cd "${tmp_dir}"
python$(python.version) -m venv "${tmp_dir}/env"
find ${package_dir} -name "*cp$(echo $(python.version) | tr -d '.')*.whl" -exec sh -c ". ${tmp_dir}/env/bin/activate && python -m pip install '{}[test]'" \;
. ${tmp_dir}/env/bin/activate && bash ${package_dir}/packaging/test_wheel.bash ${package_dir}
cd -
condition: succeeded()
displayName: 'Test Linux Wheel with Python $(python.version)'
- template: ci/upload-wheels.yml
8 changes: 0 additions & 8 deletions packaging/test_cli.bash

This file was deleted.

2 changes: 2 additions & 0 deletions packaging/test_wheel.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# A simple set of tests checking if a wheel is working correctly
set -xe

python -m pytest "$1/test/unit/pybind"
find "$1/test/" "$1/nmodl/ext/" \
-name "*.mod" \
-exec nmodl '{}' sympy --analytic \; \
-exec python -c "import nmodl; driver = nmodl.NmodlDriver(); driver.parse_file('{}')" \;
11 changes: 4 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,21 @@ NMODL_BUILD_WHEEL = "ON"

[tool.cibuildwheel]
skip = ["pp*", "*-win32", "*-manylinux_i686", "*-musllinux_i686", "*-musllinux_x86_64", "*-musllinux_aarch64"]
test-extras = ["test"]
test-command = [
"pytest {package}/test/unit/pybind",
"bash {package}/packaging/test_wheel.bash {package}",
]
test-extras = ["test"]

[tool.cibuildwheel.macos]
environment = { PATH = "/opt/homebrew/opt/flex/bin:/opt/homebrew/opt/bison/bin:/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH", MACOSX_DEPLOYMENT_TARGET = "10.15" }
config-settings = {build-dir = "_build"}
test-command = [
"pytest {package}/test/unit/pybind",
"bash {package}/packaging/test_wheel.bash {package}",
"bash {package}/packaging/test_cli.bash {package}",
]

[tool.cibuildwheel.linux]
before-all = "bash packaging/install_dependencies.sh"
environment = { PATH = "/nmodlwheel/flex/bin:/nmodlwheel/bison/bin:$PATH" }
# the Linux wheel is not tested in cibuildwheel due to manylinux images not having
# libpython*.so, so this is tested manually in the CI
test-command = "true"

[tool.pytest.ini_options]
testpaths = "test/unit/pybind"

0 comments on commit e54ee01

Please sign in to comment.