|
4 | 4 | import os.path |
5 | 5 | import subprocess |
6 | 6 |
|
7 | | -VERSION_PATH='jsonpath_rw/VERSION' |
8 | | - |
9 | | -# Ensure that the VERSION file is shipped with the distribution |
10 | | -if 'sdist' in sys.argv: |
11 | | - import jsonpath_rw.version |
12 | | - with io.open(VERSION_PATH, 'w', encoding='ascii') as fh: |
13 | | - fh.write(jsonpath_rw.version.git_version()) |
14 | | - |
15 | | -# This requires either jsonpath_rw/VERSION or to be in a git clone (as does the package in general) |
16 | | -# This is identical to code in jsonpath_rw.version. It would be nice to re-use but importing requires all deps |
17 | | -def stored_version(): |
18 | | - if os.path.exists(VERSION_PATH): |
19 | | - with io.open(VERSION_PATH, encoding='ascii') as fh: |
20 | | - return fh.read().strip() |
21 | | - else: |
22 | | - return None |
23 | | - |
24 | | -def git_version(): |
25 | | - described_version_bytes = subprocess.Popen(['git', 'describe'], stdout=subprocess.PIPE).communicate()[0].strip() |
26 | | - return described_version_bytes.decode('ascii') |
27 | | - |
28 | | -version = stored_version() or git_version() |
29 | | - |
30 | 7 | setuptools.setup( |
31 | 8 | name='jsonpath-rw', |
32 | | - version=version, |
| 9 | + version='1.2.3a1', |
33 | 10 | description='A robust and significantly extended implementation of JSONPath for Python, with a clear AST for metaprogramming.', |
34 | 11 | author='Kenneth Knowles', |
35 | 12 | author_email='kenn.knowles@gmail.com', |
36 | 13 | url='https://github.com/kennknowles/python-jsonpath-rw', |
37 | 14 | license='Apache 2.0', |
38 | 15 | long_description=io.open('README.rst', encoding='utf-8').read(), |
39 | 16 | packages = ['jsonpath_rw'], |
40 | | - package_data = {'': ['VERSION']}, |
41 | 17 | test_suite = 'tests', |
42 | 18 | install_requires = [ 'ply', 'decorator', 'six' ], |
43 | 19 | classifiers = [ |
|
0 commit comments