Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Farama Notifications #99

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading