From 685c796e33ddb0f6301a205d03dedb1bed14c30c Mon Sep 17 00:00:00 2001 From: Will Furnass Date: Tue, 8 Oct 2019 20:02:35 +0100 Subject: [PATCH] Add tox and travis config for automated tests --- .gitignore | 3 ++- .travis.yml | 13 +++++++++++++ MANIFEST.in | 1 + README.md | 15 ++++++++++++++- setup.py | 27 ++++++++++++++++++++------- tox.ini | 25 +++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 .travis.yml create mode 100644 MANIFEST.in create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 38ea0f6..6a52a94 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,5 @@ target/ .settings .project -.pydevproject \ No newline at end of file +.pydevproject +.mypy_cache/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b506daa --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +sudo: false +language: python +python: + - "2.7" + - "3.5" + - "3.6" + - "3.7" +install: + - pip install tox-travis codecov +script: + - tox + - ls -l .coverage + - codecov diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..391b5dc --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include AUTHORS.txt diff --git a/README.md b/README.md index e7a8815..06ee7c1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Deep GP -===== +======= The Python Implementation of Deep Gaussian Processes @@ -7,3 +7,16 @@ Currently implemented models are * Deep GPs * Variational Auto-encoded Deep GPs + +Testing locally +--------------- + +To run the PyDeepGP test suite on your own machine: + +1. Install [tox][tox] +2. Clone this repo +3. `cd` into this repo +4. Run `tox` to run the test suite and report test outcomes + +[tox]: https://tox.readthedocs.io/en/latest/ + diff --git a/setup.py b/setup.py index aba2e6c..5537227 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import io import os from setuptools import setup -import numpy # Version number version = '1.0' def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() + with open(fname) as f: + contents = f.read() + return contents setup(name = 'DGP', version = version, @@ -27,16 +29,27 @@ def read(fname): package_dir={'deepgp': 'deepgp'}, py_modules = ['deepgp.__init__'], long_description=read('README.md'), - install_requires=['numpy>=1.7', 'scipy>=0.12','GPy>=1.0'], - include_dirs=[numpy.get_include()], + install_requires=[ + 'numpy>=1.7', + 'scipy>=0.12', + 'GPy>=1.0', + ], + extras_require={ + 'test': [ + 'matplotlib', + 'h5py', + 'tables', + 'theano', + ], + }, classifiers=['License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5' + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7' ] ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..5040e76 --- /dev/null +++ b/tox.ini @@ -0,0 +1,25 @@ +[tox] +envlist = py27, py35, py36, py37 +[testenv] +extras = + test +passenv = DISPLAY BROWSER TOXENV CI TRAVIS TRAVIS_* +install_command = pip install {opts} {packages} +deps = codecov>=1.4.0 +#whitelist_externals = +commands = + python -m unittest deepgp.testing.model_tests_basic + +; Used by pytest-cov +[run] +branch = True +source = deepgp + +; Used by pytest-cov +[report] +exclude_lines = + if self.debug: + pragma: no cover + raise NotImplementedError + if __name__ == .__main__.: +ignore_errors = True