Permalink
Browse files

Completely removed reliance upon the VERSION file; bumped to v0.0.3.

  • Loading branch information...
1 parent 39a5fe6 commit fe34d10bf1fa1c9fdf6c2e97d982c71bb1d81f96 @zacharyvoase zacharyvoase committed Apr 4, 2011
Showing with 11 additions and 11 deletions.
  1. +0 −1 MANIFEST.in
  2. +0 −1 VERSION
  3. +1 −6 jsonpipe.py
  4. +10 −3 setup.py
View
@@ -1,2 +1 @@
include distribute_setup.py
-include VERSION
View
@@ -1 +0,0 @@
-0.0.2
View
@@ -10,12 +10,7 @@
__all__ = ['JSONPiper', 'jsonpipe']
-
-# Read in the version from the VERSION file.
-version_filename = p.join(p.dirname(__file__), 'VERSION')
-with open(version_filename) as version_file:
- __version__ = version_file.read().strip()
-del version_filename, version_file
+__version__ = '0.0.3'
class JSONPiper(object):
View
@@ -4,20 +4,27 @@
from distribute_setup import use_setuptools
use_setuptools()
+import re
from setuptools import setup
import os.path as p
-VERSION = open(p.join(p.dirname(p.abspath(__file__)), 'VERSION')).read().strip()
+
+def get_version():
+ source = open(p.join(p.dirname(p.abspath(__file__)), 'jsonpipe.py')).read()
+ match = re.search(r'__version__\s*=\s*[\'"]([^\'"]+)[\'"]', source)
+ if not match:
+ raise RuntimeError("Couldn't find the version string in jsonpipe.py")
+ return match.group(1)
+
setup(
name='jsonpipe',
- version=VERSION,
+ version=get_version(),
description="Convert JSON to a UNIX-friendly line-based format.",
author='Zachary Voase',
author_email='z@dvxhouse.com',
url='http://github.com/dvxhouse/jsonpipe',
py_modules=['jsonpipe'],
- data_files=[('', ['VERSION'])],
entry_points={'console_scripts': ['jsonpipe = jsonpipe:main']},
install_requires=['simplejson>=2.1.3', 'argparse>=1.2.1'],
test_suite='jsonpipe._get_tests',

0 comments on commit fe34d10

Please sign in to comment.