diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b7406cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +# Temporary files +*~ +\#*# + +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 +__pycache__ + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# vi +.*.swp + +# Sphinx builds +doc/source/generated + +# OSX files +.DS_Store diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8d7364d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +Check on http://lint.travis-ci.org/ after modifying it! +sudo: false +language: python +env: + - PYVERSION=3.5 USE_CYTHON=TRUE +before_install: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh + - chmod +x miniconda.sh + - ./miniconda.sh -b + - export PATH=/home/travis/miniconda3/bin:$PATH + # Update conda itself + - conda update --yes conda + # Useful for debugging any issues with conda +install: + - conda create --yes -n test_env python=$PYVERSION --file ci/conda_requirements.txt -c biocore + - conda install --yes -n test_env cython + - source activate test_env + - pip install -r ci/pip_requirements.txt + - pip install -e . + - ./scripts/run_the_ipys.sh ipynb/ +script: + - make all +notifications: + webhooks: + on_success: change + on_failure: always diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5262b26 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.DEFAULT_GOAL := help + +TEST_COMMAND = nosetests --with-doctest + +help: + @echo 'Use "make test" to run all the unit tests and docstring tests.' + @echo 'Use "make pep8" to validate PEP8 compliance.' + @echo 'Use "make html" to create html documentation with sphinx' + @echo 'Use "make all" to run all the targets listed above.' +test: + $(TEST_COMMAND) +pep8: + flake8 gneiss setup.py + +all: pep8 test diff --git a/README.md b/README.md index 4112093..a1b960d 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -# gneiss \ No newline at end of file +# gneiss + +Canonically pronouced *nice* + +A compositional statistics and visualization toolbox diff --git a/ci/conda_requirements.txt b/ci/conda_requirements.txt new file mode 100644 index 0000000..21daeee --- /dev/null +++ b/ci/conda_requirements.txt @@ -0,0 +1,7 @@ +pip +nose +pep8 +flake8 +IPython<4.0.0 +notebook +scikit-bio diff --git a/ci/pip_requirements.txt b/ci/pip_requirements.txt new file mode 100644 index 0000000..72321f8 --- /dev/null +++ b/ci/pip_requirements.txt @@ -0,0 +1,2 @@ +coveralls +ete3 diff --git a/gneiss/__init__.py b/gneiss/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2d9f4f7 --- /dev/null +++ b/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +# ---------------------------------------------------------------------------- +# Copyright (c) 2016--, gneiss development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# ---------------------------------------------------------------------------- + +import re +import ast +import os + +from setuptools import find_packages, setup +from setuptools.command.build_ext import build_ext as _build_ext + + +class build_ext(_build_ext): + def finalize_options(self): + _build_ext.finalize_options(self) + # Prevent numpy from thinking it is still in its setup process: + __builtins__.__NUMPY_SETUP__ = False + import numpy + self.include_dirs.append(numpy.get_include()) +# Dealing with Cython +USE_CYTHON = os.environ.get('USE_CYTHON', False) +ext = '.pyx' if USE_CYTHON else '.c' + +extensions = [ +] + +if USE_CYTHON: + from Cython.Build import cythonize + extensions = cythonize(extensions) + +classes = """ + Development Status :: 0 - pre-alpha + License :: OSI Approved :: BSD License + Topic :: Software Development :: Libraries + Topic :: Scientific/Engineering + Topic :: Scientific/Engineering :: Bio-Informatics + Programming Language :: Python :: 2 + Programming Language :: Python :: 2 :: Only + Operating System :: Unix + Operating System :: POSIX + Operating System :: MacOS :: MacOS X +""" +classifiers = [s.strip() for s in classes.split('\n') if s] + +description = ('Compositional data analysis tools and visualizations') + +with open('README.md') as f: + long_description = f.read() + + +# version parsing from __init__ pulled from Flask's setup.py +# https://github.com/mitsuhiko/flask/blob/master/setup.py +_version_re = re.compile(r'__version__\s+=\s+(.*)') + +with open('gneiss/__init__.py', 'rb') as f: + hit = _version_re.search(f.read().decode('utf-8')).group(1) + version = str(ast.literal_eval(hit)) + +setup(name='gneiss', + version=version, + license='BSD', + description=description, + long_description=long_description, + author="gneiss development team", + author_email="jamietmorton@gmail.com", + maintainer="gneiss development team", + maintainer_email="jamietmorton@gmail.com", + packages=find_packages(), + setup_requires=['numpy >= 1.9.2'], + ext_modules=extensions, + cmdclass={'build_ext': build_ext}, + install_requires=[ + 'IPython >= 3.2.0', + 'matplotlib >= 1.4.3', + 'numpy >= 1.9.2', + 'pandas >= 0.18.0', + 'scipy >= 0.15.1', + 'nose >= 1.3.7', + 'scikit-bio>=0.4.2', + 'ete3', + ], + classifiers=classifiers, + package_data={ + } + )