-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsetup.py
More file actions
133 lines (112 loc) · 3.44 KB
/
setup.py
File metadata and controls
133 lines (112 loc) · 3.44 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import fnmatch
import os
import re
from pathlib import Path
from setuptools import find_packages
from setuptools import setup
_here = Path(__file__).resolve().parent
name = "dexterity"
# Reference: https://github.com/patrick-kidger/equinox/blob/main/setup.py
with open(_here / name / "__init__.py") as f:
meta_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M)
if meta_match:
version = meta_match.group(1)
else:
raise RuntimeError("Unable to find __version__ string.")
with open(_here / "README.md", "r") as f:
readme = f.read()
core_requirements = [
"absl-py",
"numpy",
"typing_extensions",
"mujoco",
"dm_control >= 1.0.1",
"dm_robotics-geometry",
"dm_robotics-transformations",
]
examples_requirements = [
"matplotlib",
"imageio",
"imageio-ffmpeg",
]
testing_requirements = [
"pytest-xdist",
]
dev_requirements = (
[
"black",
"isort",
"flake8",
"mypy",
"ipdb",
"jupyter",
]
+ testing_requirements
+ examples_requirements
)
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
author = "Kevin Zakka"
author_email = "kevinarmandzakka@gmail.com"
description = "Software and tasks for dexterous multi-fingered hand manipulation, powered by MuJoCo"
# Reference: https://github.com/deepmind/dm_control/blob/main/setup.py
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=name,
version=version,
author=author,
author_email=author_email,
maintainer=author,
maintainer_email=author_email,
description=description,
long_description=readme,
long_description_content_type="text/markdown",
url=f"https://github.com/kevinzakka/{name}",
license="MIT",
license_files=("LICENSE",),
packages=find_packages(),
package_data={
"dexterity": find_data_files(
package_dir="dexterity",
patterns=["*.msh", "*.png", "*.skn", "*.stl", "*.xml", "*.typed"],
excludes=[],
),
},
zip_safe=True,
python_requires=">=3.7",
install_requires=core_requirements,
classifiers=classifiers,
extras_require={
"testing": testing_requirements,
"examples": examples_requirements,
"dev": dev_requirements,
},
)