setup.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. """Setups up the Minigrid module."""
  2. from setuptools import find_packages, setup
  3. def get_description():
  4. """Gets the description from the readme."""
  5. with open("README.md") as fh:
  6. long_description = ""
  7. header_count = 0
  8. for line in fh:
  9. if line.startswith("##"):
  10. header_count += 1
  11. if header_count < 2:
  12. long_description += line
  13. else:
  14. break
  15. return header_count, long_description
  16. def get_version():
  17. """Gets the minigrid version."""
  18. path = "minigrid/__init__.py"
  19. with open(path) as file:
  20. lines = file.readlines()
  21. for line in lines:
  22. if line.startswith("__version__"):
  23. return line.strip().split()[-1].strip().strip('"')
  24. raise RuntimeError("bad version data in __init__.py")
  25. # pytest is pinned to 7.0.1 as this is last version for python 3.6
  26. extras = {"testing": ["pytest==7.0.1"]}
  27. version = get_version()
  28. header_count, long_description = get_description()
  29. setup(
  30. name="Minigrid",
  31. version=version,
  32. author="Farama Foundation",
  33. author_email="contact@farama.org",
  34. description="Minimalistic gridworld reinforcement learning environments",
  35. url="https://minigrid.farama.org/",
  36. license="Apache",
  37. license_files=("LICENSE",),
  38. long_description=long_description,
  39. long_description_content_type="text/markdown",
  40. keywords=["Memory, Environment, Agent, RL, Gymnasium"],
  41. python_requires=">=3.7, <3.11",
  42. packages=[package for package in find_packages() if package.startswith("minigrid")],
  43. include_package_data=True,
  44. install_requires=[
  45. "gymnasium>=0.26",
  46. "numpy>=1.18.0",
  47. "matplotlib>=3.0",
  48. ],
  49. classifiers=[
  50. "Development Status :: 5 - Production/Stable",
  51. "Programming Language :: Python :: 3",
  52. "Programming Language :: Python :: 3.7",
  53. "Programming Language :: Python :: 3.8",
  54. "Programming Language :: Python :: 3.9",
  55. "Programming Language :: Python :: 3.10",
  56. ],
  57. extras_require=extras,
  58. entry_points={
  59. "gymnasium.envs": ["__root__ = minigrid.__init__:register_minigrid_envs"]
  60. },
  61. tests_require=extras["testing"],
  62. )