mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Move the DLL dir add to where it's actually needed
This commit is contained in:
parent
0cf9450e80
commit
27041e4351
@ -6,7 +6,7 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from setup import Command, is_ci, ismacos
|
from setup import Command, is_ci, ismacos, iswindows
|
||||||
|
|
||||||
TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build misc dbcli ebooks'.split())
|
TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build misc dbcli ebooks'.split())
|
||||||
|
|
||||||
@ -54,12 +54,19 @@ class Test(BaseTest):
|
|||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings('ignore', message="'cgi' is deprecated and slated for removal in Python 3.13")
|
warnings.filterwarnings('ignore', message="'cgi' is deprecated and slated for removal in Python 3.13")
|
||||||
|
|
||||||
if is_ci and ismacos:
|
if is_ci:
|
||||||
import ctypes
|
SW = os.environ['SW']
|
||||||
sys.libxml2_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libxml2.dylib'))
|
if ismacos:
|
||||||
sys.libxslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libxslt.dylib'))
|
import ctypes
|
||||||
sys.libexslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libexslt.dylib'))
|
sys.libxml2_dylib = ctypes.CDLL(os.path.join(SW, 'lib', 'libxml2.dylib'))
|
||||||
print(sys.libxml2_dylib, sys.libxslt_dylib, sys.libexslt_dylib, file=sys.stderr, flush=True)
|
sys.libxslt_dylib = ctypes.CDLL(os.path.join(SW, 'lib', 'libxslt.dylib'))
|
||||||
|
sys.libexslt_dylib = ctypes.CDLL(os.path.join(SW, 'lib', 'libexslt.dylib'))
|
||||||
|
print(sys.libxml2_dylib, sys.libxslt_dylib, sys.libexslt_dylib, file=sys.stderr, flush=True)
|
||||||
|
elif iswindows:
|
||||||
|
ffmpeg_dll_dir = os.path.join(SW, 'ffmpeg', 'bin')
|
||||||
|
os.add_dll_directory(ffmpeg_dll_dir)
|
||||||
|
|
||||||
|
|
||||||
from calibre.utils.run_tests import filter_tests_by_name, find_tests, remove_tests_by_name, run_cli
|
from calibre.utils.run_tests import filter_tests_by_name, find_tests, remove_tests_by_name, run_cli
|
||||||
tests = find_tests(which_tests=frozenset(opts.test_module), exclude_tests=frozenset(opts.exclude_test_module))
|
tests = find_tests(which_tests=frozenset(opts.test_module), exclude_tests=frozenset(opts.exclude_test_module))
|
||||||
if opts.test_name:
|
if opts.test_name:
|
||||||
|
@ -86,9 +86,6 @@ def setup_env():
|
|||||||
os.environ['CI'] = 'true'
|
os.environ['CI'] = 'true'
|
||||||
os.environ['OPENSSL_MODULES'] = os.path.join(SW, 'lib', 'ossl-modules')
|
os.environ['OPENSSL_MODULES'] = os.path.join(SW, 'lib', 'ossl-modules')
|
||||||
os.environ['PIPER_TTS_DIR'] = os.path.join(SW, 'piper')
|
os.environ['PIPER_TTS_DIR'] = os.path.join(SW, 'piper')
|
||||||
ffmpeg_dll_dir = os.path.join(SW, 'ffmpeg', 'bin')
|
|
||||||
if os.path.exists(ffmpeg_dll_dir): # doesnt exist in install phase
|
|
||||||
os.add_dll_directory(ffmpeg_dll_dir)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user