summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Socol <me@jamessocol.com>2013-03-25 13:08:55 -0400
committerJames Socol <me@jamessocol.com>2013-03-25 13:08:55 -0400
commite81fb4dea2077f6e9e873d07db831bbf931df174 (patch)
treeab038afea0c06bc51b13ca61972f0a322f79b147
parent7a5c6a0f6f7159591992401fde44f47f9dd6f0df (diff)
downloadpystatsd-e81fb4dea2077f6e9e873d07db831bbf931df174.tar.gz
Move __version__ to _version.py.v2.0.1
- Fixes installs with Django 1.5 in the environment. - Steal get_version in setup.py from elasticutils.
-rw-r--r--CHANGES6
-rw-r--r--setup.py21
-rw-r--r--statsd/__init__.py5
-rw-r--r--statsd/_version.py1
4 files changed, 26 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index e621e25..27406cf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
Statsd Changelog
================
+Version 2.0.1
+-------------
+
+- Fix install with Django 1.5 in the environment.
+
+
Version 2.0
-----------
diff --git a/setup.py b/setup.py
index 781469b..01df43e 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,25 @@
-from setuptools import setup, find_packages
+import os
+import re
+from setuptools import find_packages, setup
+
+
+VERSIONFILE = os.path.join('statsd', '_version.py')
+VSRE = r'^__version__ = [\'"]([^\'"]*)[\'"]'
+
+
+def get_version():
+ verstrline = open(VERSIONFILE, "rt").read()
+ mo = re.search(VSRE, verstrline, re.M)
+ if mo:
+ return mo.group(1)
+ else:
+ raise RuntimeError(
+ "Unable to find version string in %s." % VERSIONFILE)
-import statsd
setup(
name='statsd',
- version=statsd.__version__,
+ version=get_version(),
description='A simple statsd client.',
long_description=open('README.rst').read(),
author='James Socol',
diff --git a/statsd/__init__.py b/statsd/__init__.py
index 2284c64..325fd9d 100644
--- a/statsd/__init__.py
+++ b/statsd/__init__.py
@@ -8,14 +8,11 @@ except ImportError:
settings = None
from .client import StatsClient
+from ._version import __version__
__all__ = ['StatsClient', 'statsd']
-VERSION = (2, 0, 0)
-__version__ = '.'.join(map(str, VERSION))
-
-
statsd = None
if settings:
diff --git a/statsd/_version.py b/statsd/_version.py
new file mode 100644
index 0000000..3f39079
--- /dev/null
+++ b/statsd/_version.py
@@ -0,0 +1 @@
+__version__ = '2.0.1'