Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rossant committed Mar 17, 2016
1 parent c10dc8c commit 5f7dec0
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = True
source = klusta

[report]
exclude_lines =
pragma: no cover
raise AssertionError
raise NotImplementedError
pass
return
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: python
sudo: false
python:
- "2.7"
- "3.4"
- "3.5"
before_install:
- pip install codecov
install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
# Create the environment.
- conda env create python=$TRAVIS_PYTHON_VERSION
- source activate klusta
- pip install klustakwik2
# Dev requirements
- pip install -r requirements-dev.txt
- pip install -e .
script:
- make test
after_success:
- codecov
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include LICENSE
include README.md

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean: clean-build clean-pyc

lint:
flake8 klusta

test: lint
py.test --cov-report term-missing --cov=klusta klusta

coverage:
coverage --html

apidoc:
python tools/api.py

build:
python setup.py sdist --formats=zip

upload:
python setup.py sdist --formats=zip upload
10 changes: 10 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Need development version of pytest for py35 compat
# https://github.com/pytest-dev/pytest/issues/744
git+https://github.com/pytest-dev/pytest.git

flake8
coverage==3.7.1
coveralls
responses
pytest-cov
nose
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[wheel]
universal = 1

[pytest]
norecursedirs = experimental _*

[flake8]
ignore=E265,E731
72 changes: 72 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# -*- coding: utf-8 -*-
# flake8: noqa

"""Installation script."""


#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------

import os
import os.path as op
import re

from setuptools import setup


#------------------------------------------------------------------------------
# Setup
#------------------------------------------------------------------------------

def _package_tree(pkgroot):
path = op.dirname(__file__)
subdirs = [op.relpath(i[0], path).replace(op.sep, '.')
for i in os.walk(op.join(path, pkgroot))
if '__init__.py' in i[2]]
return subdirs


curdir = op.dirname(op.realpath(__file__))
readme = open(op.join(curdir, 'README.md')).read()


# Find version number from `__init__.py` without executing it.
filename = op.join(curdir, 'klusta/__init__.py')
with open(filename, 'r') as f:
version = re.search(r"__version__ = '([^']+)'", f.read()).group(1)


setup(
name='klusta',
version=version,
license="BSD",
description='Spike detection and automatic clustering for spike sorting',
long_description=readme,
author='Kwik Team',
author_email='cyrille.rossant at gmail.com',
url='https://klusta.cortexlab.net',
packages=_package_tree('klusta'),
package_dir={'klusta': 'klusta'},
package_data={
'klusta': ['*.txt', '*.prb'],
},
entry_points={
'console_scripts': [
'klusta = klusta.utils.cli:klusta'
],
},
include_package_data=True,
keywords='klusta,neuroscience,spike sorting,klustakwik',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)

0 comments on commit 5f7dec0

Please sign in to comment.