forked from pymodbus-dev/pymodbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (32 loc) · 1.16 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
#!/usr/bin/env python3
"""Installs pymodbus using setuptools."""
# --------------------------------------------------------------------------- #
# initialization
# --------------------------------------------------------------------------- #
from setuptools import find_packages, setup
try:
from setup_commands import command_classes
except ImportError:
command_classes = {}
from pymodbus import __author__, __maintainer__, __version__
dependencies = {}
with open('requirements.txt') as reqs:
option = None
for line in reqs.read().split('\n'):
if line == '':
option = None
elif line.startswith('# install:'):
option = line.split(':')[1]
dependencies[option] = []
elif not line.startswith('#') and option:
dependencies[option].append(line)
install_req = dependencies['required']
del dependencies['required']
# --------------------------------------------------------------------------- #
# configuration
# --------------------------------------------------------------------------- #
setup(
install_requires=install_req,
extras_require=dependencies,
cmdclass=command_classes,
)