44#
55# List of environment variables used:
66#
7- # NLE_PACKAGE_NAME
8- # Prefix of the generated package (defaults to "nle").
9- #
107# NLE_BUILD_RELEASE
118# If set, builds wheel (s)dist such as to prepare it for upload to PyPI.
129#
@@ -71,48 +68,7 @@ def build_extension(self, ext):
7168 sys .exit (1 )
7269
7370
74- packages = [
75- "nle" ,
76- "nle.dataset" ,
77- "nle.env" ,
78- "nle.nethack" ,
79- "nle.agent" ,
80- "nle.scripts" ,
81- "nle.tests" ,
82- ]
83-
84- entry_points = {
85- "console_scripts" : [
86- "nle-play = nle.scripts.play:main" ,
87- "nle-ttyrec = nle.scripts.ttyrec:main" ,
88- "nle-ttyplay = nle.scripts.ttyplay:main" ,
89- "nle-ttyplay2 = nle.scripts.ttyplay2:main" ,
90- "nle-read-tty = nle.scripts.read_tty:main" ,
91- ]
92- }
93-
94-
95- extras_deps = {
96- "dev" : [
97- "pre-commit>=2.0.1" ,
98- "isort>=5.13.2" ,
99- "cmake_format>=0.6.10" ,
100- "memory-profiler>=0.60.0" ,
101- "pytest>=6.2.5" ,
102- "pytest-benchmark>=3.4.1" ,
103- "sphinx>=2.4.4" ,
104- "sphinx-rtd-theme>=0.4.3" ,
105- "setuptools>=69.5.1" ,
106- "ruff>=0.4.3" ,
107- ],
108- "agent" : ["torch>=1.3.1" ],
109- }
110-
111- extras_deps ["all" ] = [item for group in extras_deps .values () for item in group ]
112-
113-
11471if __name__ == "__main__" :
115- package_name = os .getenv ("NLE_PACKAGE_NAME" , "nle" )
11672 cwd = os .path .dirname (os .path .abspath (__file__ ))
11773 version = open ("version.txt" , "r" ).read ().strip ()
11874 sha = "Unknown"
@@ -128,36 +84,18 @@ def build_extension(self, ext):
12884
12985 if sha != "Unknown" and not os .getenv ("NLE_RELEASE_BUILD" ):
13086 version += "+" + sha [:7 ]
87+ package_name = setuptools .find_packages ()[0 ]
13188 print ("Building wheel {}-{}" .format (package_name , version ))
13289
13390 version_path = os .path .join (cwd , "nle" , "version.py" )
13491 with open (version_path , "w" ) as f :
13592 f .write ("__version__ = '{}'\n " .format (version ))
13693 f .write ("git_version = {}\n " .format (repr (sha )))
13794
138- with open ("README.md" ) as f :
139- long_description = f .read ()
140-
14195 setuptools .setup (
142- name = package_name ,
14396 version = version ,
144- description = (
145- "The NetHack Learning Environment (NLE): "
146- "a reinforcement learning environment based on NetHack"
147- ),
148- long_description = long_description ,
149- long_description_content_type = "text/markdown" ,
150- author = "The NLE Dev Team" ,
151- url = "https://github.com/NetHack-LE/nle" ,
152- license = "NetHack General Public License" ,
153- entry_points = entry_points ,
154- packages = packages ,
15597 ext_modules = [setuptools .Extension ("nle" , sources = [])],
15698 cmdclass = {"build_ext" : CMakeBuild },
157- setup_requires = ["pybind11>=2.2" ],
158- install_requires = ["pybind11>=2.2" , "numpy>=1.16" , "gymnasium==1.2.0" ],
159- extras_require = extras_deps ,
160- python_requires = ">=3.10" ,
16199 classifiers = [
162100 "License :: OSI Approved :: Nethack General Public License" ,
163101 "Development Status :: 5 - Production/Stable" ,
0 commit comments