diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index b07c2fe37..9bd548be6 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -1,4 +1,4 @@ -name: Build Python wheels and make a release +name: Build Python wheels and make PyPI release on: workflow_dispatch: diff --git a/src/lib_python/__init__.py.in b/src/lib_python/__init__.py.in index f351bed2b..1610248ee 100644 --- a/src/lib_python/__init__.py.in +++ b/src/lib_python/__init__.py.in @@ -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}" @@ -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] @@ -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 diff --git a/tests/build_test_cibuildwheel_linux.sh b/tests/build_test_cibuildwheel_linux.sh index a79ee8deb..61077e08a 100755 --- a/tests/build_test_cibuildwheel_linux.sh +++ b/tests/build_test_cibuildwheel_linux.sh @@ -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" @@ -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) diff --git a/tests/local_builds_dockerfiles/apt+conda-based.Dockerfile b/tests/local_builds_dockerfiles/apt+conda-based.Dockerfile index c34c019e4..7f019547b 100644 --- a/tests/local_builds_dockerfiles/apt+conda-based.Dockerfile +++ b/tests/local_builds_dockerfiles/apt+conda-based.Dockerfile @@ -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 diff --git a/tests/local_builds_dockerfiles/apt-based.Dockerfile b/tests/local_builds_dockerfiles/apt-based.Dockerfile index cc7613016..ccb40f109 100644 --- a/tests/local_builds_dockerfiles/apt-based.Dockerfile +++ b/tests/local_builds_dockerfiles/apt-based.Dockerfile @@ -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 diff --git a/tests/local_builds_dockerfiles/conda-based.Dockerfile b/tests/local_builds_dockerfiles/conda-based.Dockerfile index a37a9fc43..cd63264a3 100644 --- a/tests/local_builds_dockerfiles/conda-based.Dockerfile +++ b/tests/local_builds_dockerfiles/conda-based.Dockerfile @@ -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 diff --git a/tests/local_builds_dockerfiles/dnf-based.Dockerfile b/tests/local_builds_dockerfiles/dnf-based.Dockerfile index 935c67045..7ffea6d4d 100644 --- a/tests/local_builds_dockerfiles/dnf-based.Dockerfile +++ b/tests/local_builds_dockerfiles/dnf-based.Dockerfile @@ -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 diff --git a/tests/wheels_test_dockerfiles/apt-based.Dockerfile b/tests/wheels_test_dockerfiles/apt-based.Dockerfile index 7c1df9e30..74d5e195f 100644 --- a/tests/wheels_test_dockerfiles/apt-based.Dockerfile +++ b/tests/wheels_test_dockerfiles/apt-based.Dockerfile @@ -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 diff --git a/tests/wheels_test_dockerfiles/conda-based.Dockerfile b/tests/wheels_test_dockerfiles/conda-based.Dockerfile index 9b4cdff3c..0937512c5 100644 --- a/tests/wheels_test_dockerfiles/conda-based.Dockerfile +++ b/tests/wheels_test_dockerfiles/conda-based.Dockerfile @@ -1,6 +1,6 @@ FROM continuumio/miniconda3:latest -WORKDIR vizdoom +WORKDIR /vizdoom COPY . ./ CMD ["bash", "./scripts/install_and_test_wheel.sh"] diff --git a/tests/wheels_test_dockerfiles/dnf-based.Dockerfile b/tests/wheels_test_dockerfiles/dnf-based.Dockerfile index 7c9c9a0bc..924c2e9b1 100644 --- a/tests/wheels_test_dockerfiles/dnf-based.Dockerfile +++ b/tests/wheels_test_dockerfiles/dnf-based.Dockerfile @@ -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