-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (44 loc) · 1.64 KB
/
Copy pathsetup.py
File metadata and controls
57 lines (44 loc) · 1.64 KB
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
"""This file defines the installation procedure of the human-robot-gym.
Owner:
Jakob Thumm (JT)
Contributors:
Changelog:
2.5.22 JT Formatted docstrings
11.5.22 JT Moved install requirements to setup.cfg
11.5.22 JT Removed long description
"""
from setuptools import find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install
def build_sara_shield():
"""Build sara-shield after main installation."""
try:
from human_robot_gym.controllers.failsafe_controller.sara_shield_build import build_sara_shield
build_sara_shield()
except Exception as e:
print(f"Warning: Failed to build sara-shield: {e}")
print("You may need to manually run: \
cd human_robot_gym/controllers/failsafe_controller/sara-shield && python setup.py install")
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
"""Run the standard develop and then build sara-shield."""
develop.run(self)
build_sara_shield()
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
"""Run the standard install and then build sara-shield."""
install.run(self)
build_sara_shield()
if __name__ == "__main__":
setup(
packages=[package for package in find_packages() if package.startswith("human_robot_gym")],
python_requires=">=3",
eager_resources=["*"],
include_package_data=True,
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
},
)