|
a |
|
b/setup.py |
|
|
1 |
import os |
|
|
2 |
import re |
|
|
3 |
import sys |
|
|
4 |
|
|
|
5 |
from setuptools import find_packages, setup |
|
|
6 |
|
|
|
7 |
if sys.version_info.major != 3: |
|
|
8 |
print("This Python is only compatible with Python 3, but you are running " |
|
|
9 |
"Python {}. The installation will likely fail.".format(sys.version_info.major)) |
|
|
10 |
|
|
|
11 |
def read(fname): |
|
|
12 |
return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8", errors="ignore").read() |
|
|
13 |
|
|
|
14 |
def fetch_requirements(): |
|
|
15 |
with open("requirements.txt", "r", encoding="utf-8", errors="ignore") as f: |
|
|
16 |
reqs = f.read().strip().split("\n") |
|
|
17 |
return reqs |
|
|
18 |
|
|
|
19 |
# https://packaging.python.org/guides/single-sourcing-package-version/ |
|
|
20 |
def find_version(version_file_path) -> str: |
|
|
21 |
with open(version_file_path, "r", encoding="utf-8", errors="ignore") as version_file: |
|
|
22 |
version_match = re.search(r"^__version_tuple__ = (.*)", version_file.read(), re.M) |
|
|
23 |
if version_match: |
|
|
24 |
ver_tup = eval(version_match.group(1)) |
|
|
25 |
ver_str = ".".join([str(x) for x in ver_tup]) |
|
|
26 |
return ver_str |
|
|
27 |
raise RuntimeError("Unable to find version tuple.") |
|
|
28 |
|
|
|
29 |
def package_files(directory): |
|
|
30 |
paths = [] |
|
|
31 |
for (path, directories, filenames) in os.walk(directory): |
|
|
32 |
for filename in filenames: |
|
|
33 |
paths.append(os.path.join('..', path, filename)) |
|
|
34 |
return paths |
|
|
35 |
|
|
|
36 |
mjc_models_files = package_files('myosuite') |
|
|
37 |
|
|
|
38 |
|
|
|
39 |
if __name__ == "__main__": |
|
|
40 |
setup( |
|
|
41 |
name="MyoSuite", |
|
|
42 |
version=find_version("myosuite/version.py"), |
|
|
43 |
author='MyoSuite Authors - Vikash Kumar (Meta AI), Vittorio Caggiano (Meta AI), Huawei Wang (University of Twente), Guillaume Durandau (University of Twente), Massimo Sartori (University of Twente)', |
|
|
44 |
author_email="vikashplus@gmail.com", |
|
|
45 |
license='Apache 2.0', |
|
|
46 |
description='Musculoskeletal environments simulated in MuJoCo', |
|
|
47 |
long_description=read('README.md'), |
|
|
48 |
long_description_content_type="text/markdown", |
|
|
49 |
url='https://sites.google.com/view/myosuite', |
|
|
50 |
classifiers=[ |
|
|
51 |
"Programming Language :: Python :: 3.8", |
|
|
52 |
"License :: OSI Approved :: Apache Software License", |
|
|
53 |
"Topic :: Scientific/Engineering :: Artificial Intelligence ", |
|
|
54 |
"Operating System :: OS Independent", |
|
|
55 |
], |
|
|
56 |
package_data={'': mjc_models_files+['../myosuite_init.py']}, |
|
|
57 |
packages=find_packages(exclude=("myosuite.agents")), |
|
|
58 |
python_requires=">=3.8", |
|
|
59 |
install_requires=fetch_requirements(), |
|
|
60 |
entry_points={ |
|
|
61 |
'console_scripts': [ |
|
|
62 |
'myoapi_init = myosuite_init:fetch_simhive', |
|
|
63 |
'myoapi_clean = myosuite_init:clean_simhive', |
|
|
64 |
], |
|
|
65 |
}, |
|
|
66 |
) |