diff --git a/.travis.yml b/.travis.yml index 3f86c4c6b1..5ec3de0160 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,11 @@ matrix: env: - PYTHON=3.7 - ARCH_CYTHON_COVERAGE=true + - os: osx + osx_image: xcode11.3 + language: generic + env: + - USE_PIP=true - python: 3.8 env: - PYTHON=3.8 @@ -78,8 +83,9 @@ matrix: - PYTEST_PATTERN="(slow or not slow)" before_install: + - source ci/travis-osx-setup.sh + - python --version - git fetch --tags - - sudo apt-get -y install pandoc # Avoid noise from matplotlib - mkdir -p $HOME/.config/matplotlib # Build package list to avoid empty package=versions @@ -98,7 +104,7 @@ before_install: install: - | if [[ "$COVERAGE" == true ]]; then - pip install -e . + pip install -e . --no-build-isolation else pip install . fi @@ -106,12 +112,11 @@ install: script: - set -e - python ci/performance.py - - echo pytest -r a -m "$PYTEST_PATTERN" ${COVERAGE_OPTS} --durations=25 arch - | if [[ "$COVERAGE" == true ]]; then + echo pytest -r a -m "$PYTEST_PATTERN" ${COVERAGE_OPTS} --durations=25 arch/tests/univariate/test_rescale.py pytest -r a -m "$PYTEST_PATTERN" ${COVERAGE_OPTS} --durations=25 arch else - pip install . mkdir arch_test cd arch_test python -c "import arch; arch.test(['-r a','-m (not slow)'])" @@ -120,7 +125,7 @@ script: - set -e - | if [[ ${DOCBUILD} = true ]]; then - sudo apt-get install -y enchant + sudo apt-get install -y enchant pandoc pip install sphinxcontrib-spelling sphinx-material pip list cd doc diff --git a/arch/tests/univariate/test_rescale.py b/arch/tests/univariate/test_rescale.py index f689674886..1eea9a8c39 100644 --- a/arch/tests/univariate/test_rescale.py +++ b/arch/tests/univariate/test_rescale.py @@ -1,5 +1,3 @@ -import sys - import numpy as np from numpy.testing import assert_allclose import pandas as pd @@ -36,12 +34,11 @@ def test_reproducibility(small_data, small_data2): pd.testing.assert_series_equal(small_data, small_data2) -@pytest.mark.skipif(sys.platform == "darwin", reason="Buggy on OSX/pip NumPy") def test_blank(small_data, std_data): small_mod = ZeroMean(small_data, volatility=GARCH(), rescale=False) - small_res = small_mod.fit(disp="off") + small_res = small_mod.fit() mod = ZeroMean(std_data, volatility=GARCH(), rescale=False) - res = mod.fit(disp="off") + res = mod.fit() assert_allclose(1e3 * small_res.params[0], res.params[0], rtol=5e-3) diff --git a/ci/travis-osx-setup.sh b/ci/travis-osx-setup.sh new file mode 100644 index 0000000000..6650115a65 --- /dev/null +++ b/ci/travis-osx-setup.sh @@ -0,0 +1,14 @@ +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + echo "OSX Python Information" + python3 --version + which python3 + which pip3 + echo unlink /usr/local/bin/python + unlink /usr/local/bin/python + echo ln -s /usr/local/bin/python3 /usr/local/bin/python + ln -s /usr/local/bin/python3 /usr/local/bin/python + echo unlink /usr/local/bin/pip + unlink /usr/local/bin/pip + echo ln -s /usr/local/bin/pip3 /usr/local/bin/pip + ln -s /usr/local/bin/pip3 /usr/local/bin/pip +fi