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
58 changes: 58 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
language: generic
os:
- linux
- osx
env:
matrix:
- CONDA_ENV=3.7
- CONDA_ENV=3.6
sudo: false
jobs:
include:
- stage: lint
os: linux
script:
- make lint
- stage: docs
os: linux
install:
- conda env create --file docs/source/environment.yml
- conda activate bmipy_docs
script:
- sphinx-apidoc --force -o docs bmipy *tests
- make -C docs clean html
- stage: deploy
if: tag =~ v.*$
script: skip
os: linux
deploy:
on:
all_branches: true
provider: pypi
user: mcflugen
password:
secure: d0lVWG54WokY88HQJRll0hshZ9apboEHdrjjs9mZKbCu6qVADp4r6xkboUuS9W4nSAVDfKZ4Q7cPdkplfGunjuhPq4McztF7jWqc1zPwVvKfJiHhGK90vqwUJwLC/zyPn2QR3HYCTmainZeGGMcsGNh5IvO5CcZg9IGR3M/EsPm6WTTu+/e1JG6fixO+cUmYsQbQ/Z2/+NSHUiFkiT8oAlLJZqZDHvvURU4jQCBeISnqRzOqR76Sy00W1gniUYXeyr8DUAZy+SHPgxIQ8tUAkB/Qg6mwNVQ2P+VEkm1feuTNUbrUYyi34XZhcjvP6AQfU1sKIsdMQvCtBTfSO1ALNy+5izKUhi1egmoarqcV/HkMho/okSWDDCkrTiYMb1904rYaTH/x6ixcefFT4X1GBLthsF+ZRBvzCQSKxKPWt/Sqn8P9CyAOIVDSJIut/nII/LfkC50fKdIz4DMIb9vtGgyknHlRxj1a2pmAwTlBF7OXV/BKaEafxapaUmAnj/V+OdFsiHn9iA4xLaQ/YgYWjI6fveiWMD+Pl7KPUDt5eK7WtiI1bfsuyuKMlyTwyunkfqJ5Y24R6DTKBksYqNpuYmzAewHTbNcJkesN/ZPvDp1zSgmYQr/IlObTvxt57ebunxn+1rByN/gO48QeUMOr9LWPSaYdHcjQSN5ZHBMKpqI=
before_install:
- |
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew remove --force $(brew list)
brew cleanup -s
rm -rf $(brew --cache)
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > $HOME/miniconda.sh
else
curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > $HOME/miniconda.sh
fi
- bash $HOME/miniconda.sh -b -p $HOME/anaconda
- export PATH="$HOME/anaconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda create -n test_env python=$CONDA_ENV
- source activate test_env
install:
- pip install . -r requirements.txt
script:
- pytest --cov=bmipy --cov-report=xml:$(pwd)/coverage.xml -vvv
after_success: coveralls
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include versioneer.py
include bmi/_version.py
include bmipy/_version.py
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache

lint: ## check style with flake8
flake8 bmi tests
flake8 bmipy tests

pretty: ## reformat files to make them look pretty
find bmi -name '*.py' | xargs isort
find tests -name '*.py' | xargs isort
black setup.py bmi tests
find bmipy -name '*.py' | xargs isort
black setup.py bmipy

test: ## run tests quickly with the default Python
py.test
Expand All @@ -65,16 +64,16 @@ test-all: ## run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
pytest --cov=bmi --cov-report= --cov-report=html --cov-config=setup.cfg
pytest --cov=bmipy --cov-report= --cov-report=html --cov-config=setup.cfg
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/api/bmi.rst
rm -f docs/api/modules.rst
sphinx-apidoc --force -o docs/api bmi *tests
rm -f docs/source/bmipy.rst
rm -f docs/source/modules.rst
sphinx-apidoc --force -o docs/source bmipy *tests
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html
$(BROWSER) docs/build/html/index.html

servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
Expand Down
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

32 changes: 32 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
BMI for Python
==============

Install
-------

Install *bmipy* with *pip*,

.. code-block:: bash

$ pip install bmipy

If you're using Anaconda, you can also install *bmipy*
with conda from the *conda-forge* channel,

.. code-block:: bash

$ conda install bmipy -c conda-forge


Usage
-----

.. code-block:: python

from bmipy import Bmi


class MyBmi(Bmi):

def initialize(self, config_file):
# Your implementation goes here
5 changes: 2 additions & 3 deletions bmi/__init__.py → bmipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from ._version import get_versions
from .bmi import Bmi


__all__ = ["Bmi"]

from ._version import get_versions
__version__ = get_versions()['version']
__version__ = get_versions()["version"]
del get_versions
Loading