-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
31 lines (27 loc) · 997 Bytes
/
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
import os
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy
def make_extension(package_path, name, include_dirs=None):
if include_dirs is None:
include_dirs = []
cy_dir = os.path.join(*package_path)
package_prefix = '.'.join(package_path)+'.'
ext = Extension(package_prefix+name,
[os.path.join(cy_dir, name+'.pyx')],
include_dirs=include_dirs)
return ext
extensions = []
# Tabular env base classes
tabular_pkg = ['rlutil', 'envs', 'tabular_cy']
extensions.append(make_extension(tabular_pkg, 'tabular_env'))
extensions.append(make_extension(tabular_pkg, 'q_iteration'))
extensions.append(make_extension(tabular_pkg, 'env_wrapper'))
# Tabular gridworld
grid_pkg = ['rlutil', 'envs', 'gridcraft']
extensions.append(make_extension(grid_pkg, 'grid_env_cy'))
extensions.append(make_extension(grid_pkg, 'grid_spec_cy'))
setup(
ext_modules=cythonize(extensions)
)