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

Add Farama notifications to the Python package #568

Merged
merged 2 commits into from
Oct 31, 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
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Python wheels and make a release
name: Build Python wheels and make PyPI release

on:
workflow_dispatch:
Expand Down
13 changes: 13 additions & 0 deletions src/lib_python/__init__.py.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys as _sys

# Version check and import
_COMPILED_PYTHON_VERSION = "@ViZDoom_PYTHON_VERSION_STR@"

_this_python_version = f"{_sys.version_info.major}.{_sys.version_info.minor}"
Expand All @@ -12,6 +13,8 @@ if _COMPILED_PYTHON_VERSION != _this_python_version:
from .vizdoom import __version__ as __version__
from .vizdoom import *


# Path helpers
import os as _os

root_path = __path__[0]
Expand All @@ -21,3 +24,13 @@ exe_path = exe_path_windows if _os.path.exists(exe_path_windows) else exe_path_u
scenarios_path = _os.path.join(__path__[0], "scenarios")
wads = [wad for wad in sorted(_os.listdir(scenarios_path)) if wad.endswith(".wad")]
configs = [cfg for cfg in sorted(_os.listdir(scenarios_path)) if cfg.endswith(".cfg")]


# Farama notifications
try:
from farama_notifications import notifications

if "vizdoom" in notifications and __version__ in notifications["vizdoom"]:
print(notifications["vizdoom"][__version__], file=_sys.stderr)
except Exception: # nosec
pass
2 changes: 2 additions & 0 deletions tests/build_test_cibuildwheel_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'

REPO_ROOT=$( dirname ${BASH_SOURCE[0]} )/..
DOCKERFILES_DIR=$( dirname ${BASH_SOURCE[0]} )/wheels_test_dockerfiles
GENERATED_DOCKERFILES_DIR=tests/test_dockerfiles
IMAGE_PREFIX="vizdoom_wheels"
Expand All @@ -23,6 +24,7 @@ DOCKERFILES_TO_BUILD_AND_RUN=(
)

# Build wheels using cibuildwheel
cd $REPO_ROOT
#export CIBW_BUILD_VERBOSITY=3 # Uncomment to see full build logs
cibuildwheel --platform linux --arch $(uname -m)

Expand Down
2 changes: 1 addition & 1 deletion tests/local_builds_dockerfiles/apt+conda-based.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Warsaw

WORKDIR vizdoom
WORKDIR /vizdoom

# Install wget
RUN apt-get update && apt-get install -y build-essential git make cmake wget
Expand Down
2 changes: 1 addition & 1 deletion tests/local_builds_dockerfiles/apt-based.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Warsaw

WORKDIR vizdoom
WORKDIR v/izdoom

# Install minimal dependencies
RUN apt update && apt install -y build-essential cmake git libboost-all-dev libsdl2-dev libopenal-dev python3-dev python3-pip
Expand Down
2 changes: 1 addition & 1 deletion tests/local_builds_dockerfiles/conda-based.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM continuumio/miniconda3:latest

WORKDIR vizdoom
WORKDIR /vizdoom

RUN conda install -y -c conda-forge gcc gxx rhash make cmake boost sdl2 openal-soft

Expand Down
2 changes: 1 addition & 1 deletion tests/local_builds_dockerfiles/dnf-based.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM fedora:latest

WORKDIR vizdoom
WORKDIR /vizdoom

# Install minimal dependencies
RUN dnf update -y && dnf clean all && dnf install -y gcc gcc-c++ make cmake git boost-devel SDL2-devel openal-soft-devel python3-devel python3-pip
Expand Down
2 changes: 1 addition & 1 deletion tests/wheels_test_dockerfiles/apt-based.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Warsaw

WORKDIR vizdoom
WORKDIR /vizdoom

# Install Python and pip
RUN apt update && apt install -y python3-dev python3-pip
Expand Down
2 changes: 1 addition & 1 deletion tests/wheels_test_dockerfiles/conda-based.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM continuumio/miniconda3:latest

WORKDIR vizdoom
WORKDIR /vizdoom

COPY . ./
CMD ["bash", "./scripts/install_and_test_wheel.sh"]
2 changes: 1 addition & 1 deletion tests/wheels_test_dockerfiles/dnf-based.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM fedora:latest

WORKDIR vizdoom
WORKDIR /vizdoom

# Install Python and pip
RUN dnf update -y && dnf clean all && dnf install -y python3-devel python3-pip
Expand Down
Loading