Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Black

on: [push, pull_request]

jobs:

format:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
args: ". --check"
26 changes: 26 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Flake8

on: [push, pull_request]

jobs:

lint:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Lint
run: |
pip install flake8
flake8 bmipy tests
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test

on: [push, pull_request]

jobs:
build-and-test:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true

- name: Show conda installation info
run: |
mamba info
mamba list

- name: Install requirements
run: |
mamba install black click jinja2 numpy
mamba list

- name: Build and install package
run: |
pip install -e .

- name: Install testing dependencies
run: mamba install --file=requirements.txt

- name: Test
run: |
python -c 'import bmipy; print(bmipy.__version__)'
pytest --cov=bmipy --cov-report=xml:$(pwd)/coverage.xml -vvv

- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
uses: AndreMiras/coveralls-python-action@v20201129
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<img src="https://zenodo.org/badge/179283861.svg"
alt="DOI"></a>

<a href='https://travis-ci.org/csdms/bmi-python'>
<img src='https://travis-ci.org/csdms/bmi-python.svg?branch=master'
<a href='https://github.com/csdms/bmi-python/actions/workflows/test.yml'>
<img src='https://github.com/csdms/bmi-python/actions/workflows/test.yml/badge.svg'
alt='Build Status'></a>

<a href='https://anaconda.org/conda-forge/bmipy'>
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from click.testing import CliRunner
import pytest
import sys

from bmipy.cmd import main

Expand All @@ -18,6 +19,9 @@ def test_cli_help():
assert "help" in result.output


@pytest.mark.skipif(
sys.platform == "win32", reason="See https://github.com/csdms/bmi-python/issues/10"
)
def test_cli_default(tmpdir):
import importlib
import sys
Expand Down
Loading