This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
102 lines (95 loc) · 2.8 KB
/
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
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
from setuptools import Extension, setup, find_packages, Command
import subprocess
from setuptools.command.install import install
from setuptools.command.develop import develop
from Cython.Build import cythonize
import numpy
class BuildGriddlyCommand(Command):
description = 'Build Griddly'
user_options = []
def run(self):
subprocess.check_call(
['./configure.sh'],
cwd='third_party/griddly',
shell=True,
)
subprocess.check_call(
['conan', 'install', 'deps/conanfile.txt', '--profile', 'default',
'--profile', 'deps/build.profile', '-s', 'build_type=Release',
'--build', 'missing', '-if', 'build'],
cwd='third_party/griddly',
)
subprocess.check_call(
['cmake', '.', '-B', 'build', '-GNinja', '-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake'],
cwd='third_party/griddly',
)
subprocess.check_call(
['cmake', '--build', 'build', '--config', 'Release'],
cwd='third_party/griddly',
)
def initialize_options(self):
pass
def finalize_options(self):
pass
class DevelopCommand(develop):
def run(self):
self.run_command('build_griddly')
subprocess.check_call(
['pip', 'install', "-e", './third_party/griddly/python/'],
)
# subprocess.check_call(
# ['pip', 'install', "-e", './third_party/meltingpot/'],
# ),
subprocess.check_call(
['pip', 'install', "-e", './third_party/sample_factory/'],
)
subprocess.check_call(
['pip', 'install', "-e", './third_party/pufferlib/'],
)
super().run()
ext_modules = [
Extension(
"env.mettagrid.c_grid", # Name of the resulting .so file
["env/mettagrid/c_grid.pyx"],
include_dirs=[numpy.get_include()],
)
]
setup(
name='metta',
version='0.1',
packages=find_packages(),
install_requires=[
"boto3",
"chex",
"conan==1.59.0",
"hydra-core",
"jmespath",
"matplotlib",
"numpy==2.0.0",
"pettingzoo",
"pynvml",
"pytest",
"PyYAML==6.0",
"raylib"
"rich",
"scipy",
"tabulate",
"tensordict",
"torchrl",
],
entry_points={
'console_scripts': [
# If you want to create any executable scripts in your package
# For example: 'script_name = module:function'
]
},
cmdclass={
'build_griddly': BuildGriddlyCommand,
'develop': DevelopCommand,
},
include_dirs=[numpy.get_include()],
ext_modules=cythonize(
ext_modules, compiler_directives={'profile': True}, annotate=True
),
)