-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
51 lines (42 loc) · 1.49 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup.py function - test stage - DO NOT USE
Created on 2019-01-17 at 15:24
@author: cook
"""
import sys
from setuptools import setup
# =============================================================================
# Define variables
# =============================================================================
# Define script name
__NAME__ = 'setup.py'
# =============================================================================
# Define functions
# =============================================================================
def get_version() -> str:
"""
Get the version from the version file
:return:
"""
# try to open version file
try:
with open('scarvs/info.yaml', 'r') as vfile:
vtext = vfile.readlines()
except Exception as e:
print('Error: Could not read version file')
print('Error: {0}'.format(e))
sys.exit(1)
# return version
return vtext[1].split(':')[-1].strip()
# =============================================================================
# Start of code
# =============================================================================
# Main code here
if __name__ == "__main__":
# ----------------------------------------------------------------------
setup(version=get_version())
# =============================================================================
# End of code
# =============================================================================