From eaa9531e57f5705cbc457a498358e74111b92f15 Mon Sep 17 00:00:00 2001 From: aymanhab Date: Tue, 27 Jun 2023 15:53:10 -0700 Subject: [PATCH] Remove setup_win_python38.py and use init.py from conda, update CMakeLists.txt accordingly. Could break windows python tests --- Bindings/Python/CMakeLists.txt | 5 ----- Bindings/Python/__init__.py | 5 +---- Bindings/Python/setup_win_python38.py | 11 ----------- 3 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 Bindings/Python/setup_win_python38.py diff --git a/Bindings/Python/CMakeLists.txt b/Bindings/Python/CMakeLists.txt index a2f64ba1b5..49593f4426 100644 --- a/Bindings/Python/CMakeLists.txt +++ b/Bindings/Python/CMakeLists.txt @@ -255,11 +255,6 @@ OpenSimPutFileInPythonPackage("${CMAKE_CURRENT_SOURCE_DIR}/setup.py" ".") OpenSimPutFileInPythonPackage("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" opensim) OpenSimPutFileInPythonPackage("${CMAKE_CURRENT_SOURCE_DIR}/report.py" opensim) -# for Python 3.8+/Windows we use a special script -# setup_win_python38.py to set additional dll directory in __init__.py on client machine -if (WIN32) - OpenSimPutFileInPythonPackage("${CMAKE_CURRENT_SOURCE_DIR}/setup_win_python38.py" ".") -endif() # Test files. If you require more test resource files, list them here. foreach(test_file diff --git a/Bindings/Python/__init__.py b/Bindings/Python/__init__.py index 4b23e394e4..d8313171ca 100644 --- a/Bindings/Python/__init__.py +++ b/Bindings/Python/__init__.py @@ -1,10 +1,7 @@ import sys import os -if (sys.version_info.major == 3 and sys.version_info.minor >= 8 and sys.platform.startswith('win')): - if (os.path.exists(os.path.join(sys.prefix, 'conda-meta'))): +if (sys.platform.startswith('win')): os.add_dll_directory(os.path.dirname(os.path.realpath(__file__))) - else: - os.add_dll_directory(DLL_PATH) from .simbody import * from .common import * diff --git a/Bindings/Python/setup_win_python38.py b/Bindings/Python/setup_win_python38.py deleted file mode 100644 index 1583e48848..0000000000 --- a/Bindings/Python/setup_win_python38.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -import sys -import os -import fileinput -if (sys.version_info.major == 3 and sys.version_info.minor >= 8 and sys.platform.startswith('win')): - install_path = os.path.abspath('../../bin') - new_path = install_path.replace(os.sep, '/') - print ('install path found as '+ new_path) - with fileinput.FileInput('opensim/__init__.py', inplace=True, backup='.bak') as file: - for line in file: - print(line.replace('DLL_PATH', "'" + new_path + "'"), end='')