Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit b1e672a

Browse files
committed
add missing file, adapte config.sh to windows-bash
1 parent 8c3c8cd commit b1e672a

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

azure/windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
source config.sh
7979
setup_test_venv
8080
pip install numpy/dist/numpy-*.whl
81-
python run_tests.py -mfull
81+
run_tests
8282
teardown_test_venv
8383
displayName: Install wheel and test
8484
condition: eq(variables['SKIP_BUILD'], 'false')

config.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Define custom utilities
22
# Test for OSX with [ -n "$IS_OSX" ]
33
# See env_vars.sh for extra environment variables
4+
if [ $(uname) == "Linux" ]; then IS_LINUX=1; fi
45
source gfortran-install/gfortran_utils.sh
56

67
function build_wheel {
@@ -36,7 +37,7 @@ function get_test_cmd {
3637

3738
function run_tests {
3839
# Runs tests on installed distribution from an empty directory
39-
if [ -z "$IS_OSX" ]; then
40+
if [ -n "$IS_LINUX" ]; then
4041
apt-get -y update && apt-get install -y gfortran
4142
fi
4243
python -c "$(get_test_cmd)"

extra_functions.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function setup_test_venv {
2+
# Create a new empty venv dedicated to testing for non-Linux platforms. On
3+
# Linux the tests are run in a Docker container.
4+
if [ $(uname) != "Linux" ]; then
5+
deactivate || echo ""
6+
$PYTHON_EXE -m venv test_venv
7+
if [ $(uname) == "Darwin" ]; then
8+
source test_venv/bin/activate
9+
else
10+
source test_venv/Scripts/activate
11+
fi
12+
# Note: the idiom "python -m pip install ..." is necessary to upgrade
13+
# pip itself on Windows. Otherwise one would get a permission error on
14+
# pip.exe.
15+
python -m pip install --upgrade pip wheel
16+
if [ "$TEST_DEPENDS" != "" ]; then
17+
pip install $TEST_DEPENDS
18+
fi
19+
fi
20+
}
21+
22+
function teardown_test_venv {
23+
if [ $(uname) != "Linux" ]; then
24+
deactivate || echo ""
25+
if [ $(uname) == "Darwin" ]; then
26+
source venv/bin/activate
27+
fi
28+
fi
29+
}

0 commit comments

Comments
 (0)