Skip to content

Commit b3ea8b1

Browse files
author
agrandiere
committed
added version.py
1 parent 9149064 commit b3ea8b1

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from setuptools import setup
22
import os
33

4-
version_file = open(os.path.join(os.path.dirname(__file__), 'VERSION'))
5-
VERSION = version_file.read().strip()
4+
VERSION = None
5+
path_version = os.path.join(os.path.dirname(__file__), '../version.py')
6+
exec(open(path_version).read())
67

78
setup(
89
name = 'sightengine',

sightengine/check.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
THE SOFTWARE.
2020
"""
2121

22-
import requests, json
22+
import requests, json, os
23+
24+
VERSION = None
25+
path_version = os.path.join(os.path.dirname(__file__), '../version.py')
26+
exec(open(path_version).read())
2327

2428
headers = requests.utils.default_headers()
2529
headers.update(
2630
{
27-
'User-Agent': 'SE-SDK-Python ' + '1.1',
31+
'User-Agent': 'SE-SDK-Python ' + VERSION,
2832
}
2933
)
3034

sightengine/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
THE SOFTWARE.
2020
"""
2121

22-
import requests, json
22+
import requests, json, os
2323
from .check import Check
2424

25+
VERSION = None
26+
path_version = os.path.join(os.path.dirname(__file__), '../version.py')
27+
exec(open(path_version).read())
28+
2529
headers = requests.utils.default_headers()
2630
headers.update(
2731
{
28-
'User-Agent': 'SE-SDK-Python ' + '1.1',
32+
'User-Agent': 'SE-SDK-Python ' + VERSION,
2933
}
3034
)
3135

version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
VERSION = "1.1"

0 commit comments

Comments
 (0)