-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·49 lines (40 loc) · 1.52 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
import os
import subprocess
from setuptools import setup, find_packages
from setuptools.command.install import install
class PreInstallCommand(install):
"""Provides a wrapper to install mininet when the package is installed"""
def run(self):
# Run this first so the install stops if it fails
self._install_mininet()
# Run the standard install
install.run(self)
def _install_mininet(self):
subprocess.call('mininet/util/install.sh -nfv', shell=True)
if 'mininet/mininet' not in os.environ['PATH']:
os.environ['PATH'] = os.environ['PATH'] + ':' + \
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'mininet', 'mininet')
setup(
name='fpga_switch_model',
version='1.0',
packages=find_packages(),
py_modules=['fpga_switch_model'],
install_requires=[
'Click',
'logging',
'numpy'
],
entry_points='''
[console_scripts]
fpga_switch_model=fpga_switch_model:cli
''',
# metadata to display on PyPI
author="Benji Levine",
author_email="b.levine@warwick.ac.uk",
description="This is a Python application for modelling networking topologies containing " + \
"some FPGA-based switches which will perform compute.",
keywords="fpga switch",
url="https://github.com/benjilev08/fpga_switch_model",
cmdclass={'install': PreInstallCommand},
)