Skip to content

Commit

Permalink
Updated setup and version handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Aug 27, 2012
1 parent ae61bf2 commit 2a7b4db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
8 changes: 3 additions & 5 deletions pyelasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@
# For Python >= 2.6
import json


__author__ = 'Robert Eanes'
__all__ = ['ElasticSearch']
__version__ = (0, 0, 3)
__version__ = '0.0.6'
__version_info__ = tuple(__version__.split('.'))

def get_version():
return "%s.%s.%s" % __version__
get_version = lambda: __version_info__


DATETIME_REGEX = re.compile('^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})T(?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2})(\.\d+)?$')
Expand All @@ -134,7 +133,6 @@ class ElasticSearchError(Exception):
pass



class NullHandler(logging.Handler):
def emit(self, record):
pass
Expand Down
36 changes: 26 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
import codecs
import os
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup


def read(*parts):
return codecs.open(os.path.join(os.path.dirname(__file__), *parts)).read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


setup(
name = "pyelasticsearch",
version = "0.0.6",
description = "Lightweight python wrapper for elasticsearch.",
long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst'), 'r').read(),
author = 'Robert Eanes',
author_email = 'python@robsinbox.com',
py_modules = ['pyelasticsearch'],
classifiers = [
'Development Status :: 2 - Pre-Alpha',
name="pyelasticsearch",
version=find_version("pyelasticsearch.py"),
description="Lightweight python wrapper for elasticsearch.",
long_description=read('README.rst'),
author='Robert Eanes',
author_email='python@robsinbox.com',
py_modules=['pyelasticsearch'],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
Expand All @@ -27,5 +43,5 @@
'requests>=0.9.0',
],
test_suite='tests',
url = 'http://github.com/rhec/pyelasticsearch'
url='http://github.com/rhec/pyelasticsearch'
)

0 comments on commit 2a7b4db

Please sign in to comment.