Skip to content

Commit

Permalink
Merge 5227b00 into 16908bc
Browse files Browse the repository at this point in the history
  • Loading branch information
alexamici committed Nov 17, 2020
2 parents 16908bc + 5227b00 commit f5eec2e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 4 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/on-push.yml
@@ -0,0 +1,61 @@
name: on-push

on: [push]

jobs:
unit-tests:
runs-on: ${{ matrix.os }}-latest
strategy:
max-parallel: 5
matrix:
os: [ubuntu]
python: [3.6, 3.7, 3.8]
include:
- os: macos
python: 3.8
- os: windows
python: 3.8

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
activate-environment: ${{ matrix.os }}-${{ matrix.python }}
# environment-file: tests/environment-${{ matrix.os }}-${{ matrix.python }}.yml
environment-file: tests/environment.yml
- name: Test with pytest
shell: bash -l {0}
run: |
conda install pytest pytest-cov
python -m pip install --no-deps -e .
pytest -v --cov=. --cov-report=xml --cov-branch .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

code-quality:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Lint with flake8
run: |
$CONDA/bin/conda install flake8
# stop the build if there are Python syntax errors or undefined names
$CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
$CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
code-style:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Check code style with black
run: |
$CONDA/bin/conda install black
$CONDA/bin/black --check .
- name: Check code style with isort
run: |
$CONDA/bin/conda install isort
$CONDA/bin/isort .
7 changes: 3 additions & 4 deletions gribapi/bindings.py
Expand Up @@ -29,10 +29,9 @@
from ._bindings import ffi, lib
except ModuleNotFoundError:
ffi = cffi.FFI()
ffi.cdef(
pkgutil.get_data(__name__, "grib_api.h").decode("utf-8")
+ pkgutil.get_data(__name__, "eccodes.h").decode("utf-8")
)
CDEF = pkgutil.get_data(__name__, "grib_api.h")
CDEF += pkgutil.get_data(__name__, "eccodes.h")
ffi.cdef(CDEF.decode("utf-8").replace("\r", "\n"))

LIBNAMES = ["eccodes", "libeccodes.so", "libeccodes"]

Expand Down
8 changes: 8 additions & 0 deletions tests/environment.yml
@@ -0,0 +1,8 @@
channels:
- defaults
- conda-forge
dependencies:
- attrs>=19.2
- cffi
- eccodes=>2.19.0
- numpy

0 comments on commit f5eec2e

Please sign in to comment.