From 97d18a00fddd3e7b96efb16c91b58cde92789339 Mon Sep 17 00:00:00 2001 From: Keith Roberts Date: Fri, 28 May 2021 19:52:34 -0300 Subject: [PATCH] Create workflows (#216) * CI testing on Github Action workflows * reflect `pybind11` change on README and no longer pin `pyamg` --- .circleci/config.yml | 94 ----------------------------------- .github/workflows/testing.yml | 49 ++++++++++++++++++ README.md | 5 +- setup.cfg | 4 +- tox.ini | 8 +-- 5 files changed, 56 insertions(+), 104 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/testing.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index fd66fad0..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,94 +0,0 @@ -version: 2 - -jobs: - lint: - docker: - - image: circleci/python:3.8.1 - steps: - - checkout - - run: pip install -U black flake8 --user - - run: black --check . - - run: flake8 . - build_3.9.0: - docker: - - image: circleci/python:3.9.0 - steps: - - checkout - - run: python --version - - run: pip --version - - run: sudo apt install -y libopenmpi3 libopenmpi-dev openmpi-bin - - run: sudo apt-get update && sudo apt install -y cmake - - run: sudo apt-get install libboost-all-dev - - run: sudo apt-get install libmpfr-dev - - run: git clone https://github.com/CGAL/cgal.git && cd cgal/ && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && sudo make install - - run: sudo apt install -y libhdf5-dev - - run: sudo apt install -y python-pybind11 - - run: pip install .[io] --user - - run: - pip install tox --user && tox -e py39 - - run: bash <(curl -s https://codecov.io/bash) - - build_3.8.1: - docker: - - image: circleci/python:3.8.1 - steps: - - checkout - - run: python --version - - run: pip --version - - run: sudo apt install -y libopenmpi3 libopenmpi-dev openmpi-bin - - run: sudo apt-get update && sudo apt install -y cmake - - run: sudo apt-get install libboost-all-dev - - run: sudo apt-get install libmpfr-dev - - run: git clone https://github.com/CGAL/cgal.git && cd cgal/ && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && sudo make install - - run: sudo apt install -y libhdf5-dev - - run: sudo apt install -y python-pybind11 - - run: pip install .[io] --user - - run: - pip install tox --user && pip uninstall -y virtualenv && tox -e py38 - - run: bash <(curl -s https://codecov.io/bash) - build_3.7.4: - docker: - - image: circleci/python:3.7.4 - steps: - - checkout - - run: python --version - - run: pip --version - - run: sudo apt install -y libopenmpi3 libopenmpi-dev openmpi-bin - - run: sudo apt-get update && sudo apt install -y cmake - - run: sudo apt-get install libboost-all-dev - - run: sudo apt-get install libmpfr-dev - - run: git clone https://github.com/CGAL/cgal.git && cd cgal/ && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && sudo make install - - run: sudo apt install -y libhdf5-dev - - run: sudo apt install -y python-pybind11 - - run: pip install .[io] --user - - run: - pip install tox --user && tox -e py37 - - run: bash <(curl -s https://codecov.io/bash) - build_3.6.5: - docker: - - image: circleci/python:3.6.5-stretch - steps: - - checkout - - run: python --version - - run: pip --version - - run: sudo apt-get update && sudo apt-cache search openmpi && sudo apt install -y libopenmpi2 libopenmpi-dev openmpi-bin - - run: sudo apt-get update && sudo apt install -y cmake - - run: sudo apt-get install libboost-all-dev - - run: sudo apt-get install libmpfr-dev - - run: git clone https://github.com/CGAL/cgal.git && cd cgal/ && git checkout 6f8f790 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && sudo make install - - run: sudo apt install -y libhdf5-dev - - run: pip install pytest --user && git clone https://github.com/pybind/pybind11.git && cd pybind11 && mkdir build && cd build && cmake .. && sudo make install - - run: pip install .[io] --user - - run: - pip install tox --user && /home/circleci/.local/bin/tox -e py36 - - run: bash <(curl -s https://codecov.io/bash) - -workflows: - version: 2 - lint_and_build: - jobs: - - lint - - build_3.6.5 - - build_3.7.4 - - build_3.8.1 - - build_3.9.0 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..3ede931b --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,49 @@ +name: ci + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - uses: actions/checkout@v2 + - name: Lint with flake8 + run: | + pip install flake8 + flake8 . + - name: Lint with black + run: | + pip install black + black --check . + + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install CGAL 5 + run: | + sudo apt install -y libcgal-dev + - name: Install other dependencies + run: | + sudo apt install -y libopenmpi3 libopenmpi-dev openmpi-bin + sudo apt install -y libhdf5-dev + - name: Test with tox + run: | + pip install tox + tox + - uses: codecov/codecov-action@v1 diff --git a/README.md b/README.md index 6e79471a..273fdd9e 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,9 @@ Table of contents Installation ============ -For installation, SeismicMesh needs [CGAL](https://www.cgal.org/) and -[pybind11](https://github.com/pybind/pybind11): +For installation, SeismicMesh needs [CGAL](https://www.cgal.org/): - sudo apt install libcgal-dev python3-pybind11 + sudo apt install libcgal-dev After that, SeismicMesh can be installed from the Python Package Index ([pypi](https://pypi.org/project/SeismicMesh/)), so with: diff --git a/setup.cfg b/setup.cfg index d8181b0b..cc36f54e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,6 @@ classifiers = Topic :: Scientific/Engineering :: Visualization [options] packages = find: -setup_requires = pybind11 >= 2.6 install_requires = numpy segyio @@ -34,8 +33,7 @@ install_requires = h5py matplotlib mpi4py - pybind11 >= 2.6 - pyamg == 4.0.0 + pyamg pytest_codeblocks python_requires = >=3.0 diff --git a/tox.ini b/tox.ini index 2139ab4b..9db5256f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36, py37, py38, py39 +envlist = py3 isolated_build = True [mpi] @@ -9,11 +9,11 @@ mpiexec = {env:MPIEXEC:mpiexec} setenv = MPLBACKEND = agg deps = - pytest-codeblocks - requests + mpi4py pytest + pytest-codeblocks pytest-cov - mpi4py + requests whitelist_externals = {[mpi]mpiexec} commands = {[mpi]mpiexec} -n 2 -mca btl ^openib pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 -m "parallel2"