Skip to content

Commit 4e32491

Browse files
authored
Merge pull request #45 from jnhyperion/master
Fix lib dependency and version
2 parents eb027c8 + c953a3b commit 4e32491

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

JSONLibrary/JSONLibraryKeywords.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
import os.path
55
from robot.api import logger
66
from robot.api.deco import keyword
7-
from robot.utils.asserts import assert_true, fail
7+
from robot.utils.asserts import fail
88
from jsonpath_ng import Index, Fields
99
from jsonpath_ng.ext import parse as parse_ng
1010
from jsonpath_ng.exceptions import JsonPathParserError
11-
from .version import VERSION
1211

1312
__author__ = 'Traitanit Huangsri'
1413
__email__ = 'traitanit.hua@gmail.com'
15-
__version__ = VERSION
1614

1715
def parse(json_path):
1816
try:

JSONLibrary/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# -*- coding: utf-8 -*-
22
from .JSONLibraryKeywords import JSONLibraryKeywords
3-
from .version import VERSION
3+
from .__version__ import __version__
44

55
__author__ = 'Traitanit Huangsri'
66
__email__ = 'traitanit.hua@gmail.com'
7-
__version__ = VERSION
87

98

109
class JSONLibrary(JSONLibraryKeywords):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
VERSION = "0.4.1"
4+
__version__ = "0.4.1"

setup.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import re
4+
import os
55
from setuptools import setup
66

7-
# Read version from file without loading the module
8-
with open('JSONLibrary/version.py', 'r') as version_file:
9-
version_match = re.search(r"^VERSION ?= ?['\"]([^'\"]*)['\"]",
10-
version_file.read(), re.M)
11-
if version_match:
12-
VERSION=version_match.group(1)
13-
else:
14-
VERSION='0.1' #
7+
HERE = os.path.abspath(os.path.dirname(__file__))
8+
version = {}
9+
with open(os.path.join(HERE, "JSONLibrary", "__version__.py"), encoding="utf8") as f:
10+
exec(f.read(), version)
1511

1612
requirements = [
17-
# 'tox>=3.0.0',
18-
'coverage>=4.2',
1913
'robotframework>=3.0',
2014
'jsonpath-ng>=1.4.3'
2115
]
@@ -35,7 +29,7 @@
3529

3630
setup(
3731
name='robotframework-jsonlibrary',
38-
version=VERSION,
32+
version=version["__version__"],
3933
description="robotframework-jsonlibrary is a Robot Framework test library for manipulating JSON Object. You can manipulate your JSON object using JSONPath",
4034
author="Traitanit Huangsri",
4135
author_email='traitanit.hua@gmail.com',

0 commit comments

Comments
 (0)