From f1b9378766cbba593fa2348019528bde16330109 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 19 Jan 2018 16:45:03 -0600 Subject: [PATCH 1/5] Add macOS install instructions. --- doc/misc.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/misc.rst b/doc/misc.rst index 874935f8..7a3d9aba 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -4,14 +4,15 @@ Installation and Usage Installing :mod:`pytential` --------------------------- -This set of instructions is intended for 64-bit Linux computers. -MacOS support is in the works. +This set of instructions is intended for 64-bit Linux and macOS computers. #. Make sure your system has the basics to build software. On Debian derivatives (Ubuntu and many more), installing ``build-essential`` should do the trick. + On macOS, run ``xcode-select --install`` to install build tools. + Everywhere else, just making sure you have the ``g++`` package should be enough. @@ -30,6 +31,8 @@ MacOS support is in the works. #. ``conda config --add channels conda-forge`` +#. (*macOS only*) ``conda install osx-pocl-opencl`` + #. ``conda install git pip pocl islpy pyopencl sympy pyfmmlib pytest`` #. Type the following command:: -- GitLab From 247a16e77c4c03483e55189b78cfe659326cdb3c Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 19 Jan 2018 17:09:45 -0600 Subject: [PATCH 2/5] CI support for macOS --- .gitlab-ci.yml | 10 ++++++++++ .test-conda-env-py3-macos.yml | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .test-conda-env-py3-macos.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad62d954..4210213f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,6 +67,16 @@ Python 2.7 POCL: except: - tags +Python 3.5 Conda Apple: + script: + - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh + - ". ./build-and-test-py-project-within-miniconda.sh" + tags: + - apple + except: + - tags + Documentation: script: - EXTRA_INSTALL="numpy mako" diff --git a/.test-conda-env-py3-macos.yml b/.test-conda-env-py3-macos.yml new file mode 100644 index 00000000..807cd696 --- /dev/null +++ b/.test-conda-env-py3-macos.yml @@ -0,0 +1,17 @@ +name: test-conda-env-py3-macos +channels: +- conda-forge +- defaults +dependencies: +- git +- conda-forge::numpy +- conda-forge::sympy +- pocl=1.0 +- islpy +- pyopencl +- python=3.5 +- symengine=0.3.0 +- python-symengine=0.3.0 +- pyfmmlib +- osx-pocl-opencl +# things not in here: loopy boxtree pymbolic meshmode sumpy -- GitLab From 2eb9936263f1bac52605886f5e55989db04cbcc2 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sat, 27 Jan 2018 19:14:05 -0600 Subject: [PATCH 3/5] Add requirements.txt to macOS CI --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4210213f..efe60c4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,6 +70,7 @@ Python 2.7 POCL: Python 3.5 Conda Apple: script: - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml + - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh - ". ./build-and-test-py-project-within-miniconda.sh" tags: -- GitLab From 82c1e90791e3843b409f907f9e561ad4970e559d Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sat, 27 Jan 2018 19:44:32 -0600 Subject: [PATCH 4/5] Try setting the locale to en_US.UTF-8 --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efe60c4d..ecf7b037 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,6 +69,8 @@ Python 2.7 POCL: Python 3.5 Conda Apple: script: + - export LC_ALL=en_US.UTF-8 + - export LANG=en_US.UTF-8 - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh -- GitLab From 3a87e34cf2d791827a4d7382637d9b023d39cd50 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 29 Jan 2018 13:12:49 -0600 Subject: [PATCH 5/5] Mark maxwell and stokes tests as slow; skip on Apple. --- .gitlab-ci.yml | 1 + setup.cfg | 4 ++++ test/test_maxwell.py | 1 + test/test_stokes.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ecf7b037..48d7cd3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,6 +71,7 @@ Python 3.5 Conda Apple: script: - export LC_ALL=en_US.UTF-8 - export LANG=en_US.UTF-8 + - export PYTEST_ADDOPTS=-k-slowtest - CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml - REQUIREMENTS_TXT=.test-conda-env-py3-requirements.txt - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh diff --git a/setup.cfg b/setup.cfg index 42291e82..a353f3f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,4 @@ + [flake8] ignore = E126,E127,E128,E123,E226,E241,E242,E265,E402,W503,N803,N806,N802,D102,D103 max-line-length=85 @@ -5,3 +6,6 @@ exclude= pytential/symbolic/old_diffop_primitives.py, pytential/symbolic/pde/maxwell/generalized_debye.py, +[tool:pytest] +markers= + slowtest: mark a test as slow diff --git a/test/test_maxwell.py b/test/test_maxwell.py index 715a7669..87420a10 100644 --- a/test/test_maxwell.py +++ b/test/test_maxwell.py @@ -213,6 +213,7 @@ class EHField(object): # {{{ driver +@pytest.mark.slowtest @pytest.mark.parametrize("case", [ #tc_int, tc_ext, diff --git a/test/test_stokes.py b/test/test_stokes.py index 1b85080f..3f456fc1 100644 --- a/test/test_stokes.py +++ b/test/test_stokes.py @@ -26,6 +26,7 @@ THE SOFTWARE. import numpy as np import pyopencl as cl import pyopencl.clmath # noqa +import pytest from meshmode.discretization import Discretization from meshmode.discretization.poly_element import \ @@ -270,6 +271,7 @@ def run_exterior_stokes_2d(ctx_factory, nelements, return qbx.h_max, l2_err +@pytest.mark.slowtest def test_exterior_stokes_2d(ctx_factory, qbx_order=3): from pytools.convergence import EOCRecorder eoc_rec = EOCRecorder() -- GitLab