Skip to content

Commit

Permalink
Update Windows scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mwydmuch committed Jan 5, 2023
1 parent bafde4d commit 8d3e11c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions scripts/build_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ for %%P in (36 37 38 39 310) do (

:: CMake command
:: %%% Minimal version
:: set CMAKE_CMD=-G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBOOST_ROOT="%BOOST_ROOT%" -DNO_ASM=ON
:: set CMAKE_CMD=-G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBOOST_ROOT="%BOOST_ROOT%"
:: %%% Version with all additional sound deps
set CMAKE_CMD=-G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBOOST_ROOT="%BOOST_ROOT%" -DNO_ASM=ON -DMPG123_INCLUDE_DIR="%MPG123_INCLUDE_DIR%" -DMPG123_LIBRARIES="%MPG123_LIBRARIES%" -DSNDFILE_INCLUDE_DIR="%SNDFILE_INCLUDE_DIR%" -DSNDFILE_LIBRARY=%SNDFILE_LIBRARY%
set CMAKE_CMD=-G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBOOST_ROOT="%BOOST_ROOT%" -DMPG123_INCLUDE_DIR="%MPG123_INCLUDE_DIR%" -DMPG123_LIBRARIES="%MPG123_LIBRARIES%" -DSNDFILE_INCLUDE_DIR="%SNDFILE_INCLUDE_DIR%" -DSNDFILE_LIBRARY=%SNDFILE_LIBRARY%

set CMAKE_CMD=!CMAKE_CMD! -DBUILD_PYTHON=ON -DPYTHON_EXECUTABLE="!PYTHON_EXECUTABLE!" -DPYTHON_INCLUDE_DIR="!PYTHON_INCLUDE_DIR!" -DPYTHON_LIBRARY="!PYTHON_LIBRARY!"

Expand Down
32 changes: 23 additions & 9 deletions scripts/test_windows_wheels.bat
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
@echo off
setlocal enabledelayedexpansion

:: Set to current ViZDoom version
set VIZDOOM_VERSION=1.1.14

:: Build wheels for all Python versions
for %%P in (37 38 39 310) do (
set PYTHON_VERSION=%%P
set PYTHON_VERSION_DOT=!PYTHON_VERSION:~0,1!.!PYTHON_VERSION:~1!
echo Testing wheels for Python !PYTHON_VERSION_DOT! ...


:: Modify these lines to point to your Python location (C:\PythonX is usually a default)
set PYTHON_LOCATION=C:\Python!PYTHON_VERSION!
set PYTHON_EXECUTABLE=!PYTHON_LOCATION!\python.exe

!PYTHON_EXECUTABLE! -m pip uninstall -y vizdoom

!PYTHON_EXECUTABLE! -m pip install --upgrade pip
!PYTHON_EXECUTABLE! -m pip install scipy opencv-python pytest gym==0.23.0 pygame==2.1.0
!PYTHON_EXECUTABLE! -m pip install scipy opencv-python pytest

set WHEEL_FILE=dist\vizdoom-!VIZDOOM_VERSION!-cp!PYTHON_VERSION!-cp!PYTHON_VERSION!-win_amd64.whl
if exist !WHEEL_FILE! (
!PYTHON_EXECUTABLE! -m pip install !WHEEL_FILE![gym]
)

!PYTHON_EXECUTABLE! -m pip install dist\vizdoom-1.1.12-cp!PYTHON_VERSION!-cp!PYTHON_VERSION!-win_amd64.whl
!PYTHON_EXECUTABLE! -m pip install dist\vizdoom-1.1.12-cp!PYTHON_VERSION!-cp!PYTHON_VERSION!m-win_amd64.whl
:: This can be removed after end of support for Python 3.7
set WHEEL_M_FILE=dist\vizdoom-!VIZDOOM_VERSION!-cp!PYTHON_VERSION!-cp!PYTHON_VERSION!m-win_amd64.whl
if exist !WHEEL_M_FILE! (
!PYTHON_EXECUTABLE! -m pip install !WHEEL_M_FILE![gym]
)

:: Test wheel from test PyPI index
rem !PYTHON_EXECUTABLE! -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ vizdoom

:: Run some examples
rem !PYTHON_EXECUTABLE! examples\python\basic.py
rem !PYTHON_EXECUTABLE! examples\python\buffers.py
rem !PYTHON_EXECUTABLE! examples\python\audio_buffer.py
!PYTHON_EXECUTABLE! examples\python\basic.py
!PYTHON_EXECUTABLE! examples\python\buffers.py
!PYTHON_EXECUTABLE! examples\python\audio_buffer.py

:: Run tests
!PYTHON_EXECUTABLE! -m pytest tests\test_enums.py
!PYTHON_EXECUTABLE! -m pytest tests\test_get_state.py
!PYTHON_EXECUTABLE! -m pytest tests\test_make_action.py
!PYTHON_EXECUTABLE! -m pytest tests\test_gym_wrapper.py
!PYTHON_EXECUTABLE! -m pytest tests\test_labels_buffer.py
!PYTHON_EXECUTABLE! -m pytest tests\test_make_action.py

!PYTHON_EXECUTABLE! -m pip uninstall -y vizdoom
)
2 changes: 1 addition & 1 deletion tests/test_gym_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from vizdoom import gym_wrapper

vizdoom_envs = [env for env in [env_spec.id for env_spec in gym.envs.registry.values()] if "Vizdoom" in env]
test_env_configs = os.path.abspath("./env_configs")
test_env_configs = f"{os.path.dirname(os.path.abspath(__file__))}/env_configs"


# Testing with different non-default kwargs (since each has a different obs space)
Expand Down

0 comments on commit 8d3e11c

Please sign in to comment.