-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·74 lines (64 loc) · 1.98 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from setuptools import find_packages, setup
# Package meta-data.
NAME = 'me4storage'
DESCRIPTION = 'Simple CLI utility for Dell ME4 Storage'
URL = 'https://gitlab.developers.cam.ac.uk/rcs/platforms/storage-services/me4storage'
EMAIL = '[email protected]'
AUTHOR = 'Matt Rásó-Barnett'
# What packages are required for this module to be executed?
REQUIRED = [
'argcomplete',
'colorlog',
'colorama',
'requests',
'packaging',
'terminaltables',
'pysftp',
'fuzzywuzzy',
'jira',
]
here = os.path.abspath(os.path.dirname(__file__))
# Import the README and use it as the long-description.
# Note: this will only work if 'README.rst' is present in your MANIFEST.in file!
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = '\n' + f.read()
# Load the package's __version__.py module as a dictionary.
about = {}
with open(os.path.join(here, 'me4storage', '__version__.py')) as f:
exec(f.read(), about)
# Check if running under Gitlab CI Pipeline, if so, take version from
# CI commit tag. Otherwise, use value from __version__.py
if os.environ.get('CI_COMMIT_TAG'):
version = os.environ['CI_COMMIT_TAG']
elif os.environ.get('CI_COMMIT_SHORT_SHA'):
version = about['__version__'] + '.' + os.environ['CI_COMMIT_SHORT_SHA']
else:
version = about['__version__']
setup(
name=NAME,
version=version,
description=DESCRIPTION,
long_description=long_description,
author=AUTHOR,
author_email=EMAIL,
url=URL,
license='MIT',
packages=find_packages(exclude=('tests', 'docs')),
# If your package is a single module, use this instead of 'packages':
# py_modules=['mypackage'],
entry_points={
'console_scripts': [
'me4cli = me4storage.cli:cli',
],
},
install_requires=REQUIRED,
extras_require={
'levenshtein': ['python-Levenshtein'],
},
include_package_data=True,
)