Skip to content

Commit

Permalink
Integrate Farama Notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
MatPoliquin committed Dec 17, 2023
1 parent d83f18a commit 0e11e11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions retro/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys

import retro.data
from retro._retro import Movie, RetroEmulator, core_path
Expand Down Expand Up @@ -61,3 +62,13 @@ def make(game, state=State.DEFAULT, inttype=retro.data.Integrations.DEFAULT, **k
f"Game not found: {game}. Did you make sure to import the ROM?",
)
return RetroEnv(game, state, inttype=inttype, **kwargs)


try:
from farama_notifications import notifications

if "stable-retro" in notifications and __version__ in notifications["stable-retro"]:
print(notifications["stable-retro"][__version__], file=sys.stderr)

except Exception: # nosec
pass
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def run(self):
url="https://github.com/farama-foundation/stable-retro",
version=open(VERSION_PATH).read().strip(),
license="MIT",
install_requires=["gymnasium>=0.27.1", "pyglet>=1.3.2,==1.*"],
install_requires=["gymnasium>=0.27.1", "pyglet>=1.3.2,==1.*", "farama-notifications >=0.0.1"],
python_requires=">=3.8.0,<3.13",
ext_modules=[Extension("retro._retro", ["CMakeLists.txt", "src/*.cpp"])],
cmdclass={"build_ext": CMakeBuild},
Expand Down

0 comments on commit 0e11e11

Please sign in to comment.