-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
74 lines (66 loc) · 2.27 KB
/
setup.py
File metadata and controls
74 lines (66 loc) · 2.27 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from setuptools import find_packages
from setuptools import setup
import fnmatch
import os
import sys
assert sys.version_info.major == 3 and sys.version_info.minor >= 6, \
"The Contextual Control Suite is designed to work with Python 3.6 " \
"and greater Please install it before proceeding."
def find_data_files(package_dir, patterns, excludes=()):
"""Recursively finds files whose names match the given shell patterns."""
paths = set()
def is_excluded(s):
for exclude in excludes:
if fnmatch.fnmatch(s, exclude):
return True
return False
for directory, _, filenames in os.walk(package_dir):
if is_excluded(directory):
continue
for pattern in patterns:
for filename in fnmatch.filter(filenames, pattern):
# NB: paths must be relative to the package directory.
relative_dirpath = os.path.relpath(directory, package_dir)
full_path = os.path.join(relative_dirpath, filename)
if not is_excluded(full_path):
paths.add(full_path)
return list(paths)
setup(
name='contextual_control_suite',
py_modules=['contextual_control_suite'],
install_requires=[
'dm-control',
'absl-py>=0.7.0',
'dm-env',
'future',
'glfw',
'labmaze',
'lxml',
'mujoco >= 2.1.5',
'numpy >= 1.9.0',
'protobuf >= 3.15.6',
'pyopengl >= 3.1.4',
'pyparsing < 3.0.0',
'requests',
'setuptools!=50.0.0', # https://github.com/pypa/setuptools/issues/2350
'scipy',
'tqdm',
],
packages=find_packages(),
package_data={
'contextual_control_suite':
find_data_files(
package_dir='contextual_control_suite',
patterns=[
'*.amc', '*.msh', '*.png', '*.skn', '*.stl', '*.xml',
'*.textproto', '*.h5'
],
excludes=[
'*/dog_assets/extras/*',
'*/kinova/meshes/*', # Exclude non-decimated meshes.
]),
},
version="1.0.0",
description="Contextual Control Suite environments.",
author="Sahand Rezaei-Shoshtari, Charlotte Morissette",
)