Skip to content

Commit

Permalink
Update windows packager and tests for Python 3.12
Browse files Browse the repository at this point in the history
This commit is a windows packager update inclusive of a recent
Python version, a C++ Visual Studio executable needed by torch,
and some test fixes so to run without errors in windows environments.

Remove no longer needed change of directory and an echo off line
that makes debugging of the packager script more difficult.
  • Loading branch information
gbladislau committed Oct 24, 2024
1 parent c691182 commit e7f0c58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions packaging/packager_win.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@Echo off

SET DISTRO="windows"
SET DISTRO_VERSION="10"
SET DISTRO_ROOT="%HOMEDRIVE%"
Expand All @@ -16,17 +14,21 @@ REM Requires VNC server and thus only available on Linux
SET DISABLE_VNCDOTOOL=1

REM Main deps
cd %DISTRO_ROOT%\
REM Assuming a local python executable to avoid overloading the download web page
START /WAIT python-3.9.0-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
START /WAIT python-3.12.6-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
REM set a temporary path variable valid inside this session
set PYTHONPATH="C:\Program Files\Python39"
set PYTHONPATH="C:\Program Files\Python312"
set PATH=%PYTHONPATH%;%PYTHONPATH%\Scripts;%PATH%
REM a permanent path variable will be set by the executable once this batch exits

REM Install the vc_redist for C++ silently
REM Assuming a local executable to avoid overloading the download web page
powershell -ExecutionPolicy Bypass -Command "Start-Process -FilePath 'C:\packages\vc_redist.x64.exe' -ArgumentList '/q' -Wait"

REM GuiBot deps
pip install --user --upgrade pip
pip install -r %DISTRO_ROOT%\guibot\packaging\pip_requirements.txt
pip install setuptools

REM GuiBot setup
echo Copying GuiBot files
Expand Down
1 change: 1 addition & 0 deletions tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def test_mouse_scroll(self) -> None:
self.child_app = None

@unittest.skipIf(os.environ.get('DISABLE_PYQT', "0") == "1", "PyQt disabled")
@unittest.skipIf(os.name == 'nt', "Windows takes too long, test fails")
def test_keys_press(self) -> None:
"""Check key press effect for all display controller backends."""
for display in self.backends:
Expand Down
5 changes: 3 additions & 2 deletions tests/test_fileresolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ class CustomFileResolverTest(unittest.TestCase):

def test_custom_paths(self) -> None:
"""Test if custom paths work correctly."""
os_name = os.name
# temporary directory 1
tmp_dir1 = mkdtemp()
fd_tmp_file1, tmp_file1 = mkstemp(prefix=tmp_dir1 + "/", suffix=".txt")
fd_tmp_file1, tmp_file1 = mkstemp(prefix=tmp_dir1 + ("/" if os_name != 'nt' else "\\"), suffix=".txt")
os.close(fd_tmp_file1)

# temporary directory 2
tmp_dir2 = mkdtemp()
fd_tmp_file2, tmp_file2 = mkstemp(prefix=tmp_dir2 + "/", suffix=".txt")
fd_tmp_file2, tmp_file2 = mkstemp(prefix=tmp_dir2 + ("/" if os_name != 'nt' else "\\"), suffix=".txt")
os.close(fd_tmp_file2)

filename1 = os.path.basename(tmp_file1)
Expand Down

0 comments on commit e7f0c58

Please sign in to comment.