commit 20fbba1230cabbc0f4644f917c6c2be52b8a63e8 Author: Honza Kral Date: Wed May 1 16:37:32 2013 +0200 Initial commit, simple python scaffold diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b9407071 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.*.swp +*~ +*.py[co] +.coverage +elasticsearch.egg-info diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..7dbc10bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python +python: + - "2.6" + - "2.7" + - "3.3" + - "pypy" +install: + - pip install -r dev_requirements.txt --use-mirrors +script: + - python setup.py test diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..03b1baf0 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,12 @@ +include AUTHORS +include INSTALL +include LICENSE +include MANIFEST.in +include README.rst +include README +include dev_requirements.txt +include requirements.txt +recursive-include doc * +recursive-include test_elasticsearch * + +global-exclude .coverage diff --git a/README b/README new file mode 120000 index 00000000..92cacd28 --- /dev/null +++ b/README @@ -0,0 +1 @@ +README.rst \ No newline at end of file diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..c830450f --- /dev/null +++ b/README.rst @@ -0,0 +1,2 @@ +Python Elasticsearch Client +=========================== diff --git a/dev_requirements.txt b/dev_requirements.txt new file mode 100644 index 00000000..9d5d7e4e --- /dev/null +++ b/dev_requirements.txt @@ -0,0 +1,4 @@ +-r requirements.txt + +nose +coverage diff --git a/elasticsearch/__init__.py b/elasticsearch/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e69de29b diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..3898a305 --- /dev/null +++ b/setup.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from os.path import join, dirname +from setuptools import setup + + +VERSION = (0, 0, 1) +__version__ = VERSION +__versionstr__ = '.'.join(map(str, VERSION)) + +f = open(join(dirname(__file__), 'README.rst')) +long_description = f.read().strip() +f.close() + +install_requires = [ +] +test_requires = [ + 'nose', + 'coverage', +] + +setup( + name = 'elasticsearch', + description = "Python client for Elasticsearch", + url = "https://github.com/elasticsearch/elasticsearch/", + long_description = long_description, + version = __versionstr__, + author = "Honza Král", + author_email = "honza.kral@gmail.com", + packages = ['elasticsearch'], + classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Operating System :: OS Independent", + ], + install_requires=install_requires, + + test_suite='test_elasticsearch.run_tests.run_all', + test_requires=test_requires, +) diff --git a/test_elasticsearch/__init__.py b/test_elasticsearch/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test_elasticsearch/run_tests.py b/test_elasticsearch/run_tests.py new file mode 100755 index 00000000..b1ff174e --- /dev/null +++ b/test_elasticsearch/run_tests.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +import sys +from os import path + +import nose + +def run_all(argv=None): + sys.exitfunc = lambda: sys.stderr.write('Shutting down....\n') + # always insert coverage when running tests + if argv is None: + argv = [ + 'nosetests', + '--with-coverage', '--cover-package=elasticsearch', '--cover-erase', + '--nocapture', '--nologcapture', + '--verbose', '--no-skip' + ] + else: + for p in ('--with-coverage', '--cover-package=elasticsearch', '--cover-erase'): + if p not in argv: + argv.append(p) + + nose.run_exit( + argv=argv, + defaultTest=path.abspath(path.dirname(__file__)) + ) + +if __name__ == '__main__': + run_all(sys.argv) + diff --git a/test_elasticsearch/test_base.py b/test_elasticsearch/test_base.py new file mode 100644 index 00000000..55f54278 --- /dev/null +++ b/test_elasticsearch/test_base.py @@ -0,0 +1,5 @@ +from nose import tools + +def test_passing(): + tools.assert_equals(1+1, 2) +