Переглянути джерело

Release 1.8.19 (#87)

* attempt at deploy script to work from 3p-packages-source

Signed-off-by: Vivien Oddou <[email protected]>

* Attempt at fixing package making scripts. In face of "testapp.py", line 121 NameEffor because of `fg.`

Signed-off-by: Vivien Oddou <[email protected]>

* Trying to understand why the 3p package still fails using explicit import names.

Signed-off-by: Vivien Oddou <[email protected]>

* Radical attempt

Signed-off-by: Vivien Oddou <[email protected]>

* try to cater to 3p environment

Signed-off-by: Vivien Oddou <[email protected]>

---------

Signed-off-by: Vivien Oddou <[email protected]>
siliconvoodoo 1 рік тому
батько
коміт
219aa9632a
3 змінених файлів з 11 додано та 3 видалено
  1. 1 1
      prepare_solution_win.bat
  2. 1 1
      test.and.py
  3. 9 1
      tests/testapp.py

+ 1 - 1
prepare_solution_win.bat

@@ -8,7 +8,7 @@ REM
 
 set platform=win
 set architecture=x64
-set generator="Visual Studio 16 2019"
+set generator="Visual Studio 17 2022"
 
 set curr_dir=%~dp0
 set src_path=%curr_dir%\src

+ 1 - 1
test.and.py

@@ -20,7 +20,7 @@ from os.path import join, normpath, basename
 import re
 import importlib
 sys.path.append("tests")
-from clr import *
+from tests.clr import *
 
 testList = ['Syntax', 'Semantic', 'Advanced', 'Samples']
 

+ 9 - 1
tests/testapp.py

@@ -11,7 +11,15 @@ import os
 import io
 from argparse import ArgumentParser
 from os.path import join, normpath, basename
-from clr import *
+import inspect
+clrpath = os.path.join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))), "clr.py")
+print(f"clr path is {clrpath}")
+import importlib.util
+spec = importlib.util.spec_from_file_location("clr", clrpath)
+clrmodule = importlib.util.module_from_spec(spec)
+sys.modules["clr"] = clrmodule
+spec.loader.exec_module(clrmodule)
+globals().update({v: vars(clrmodule)[v] for v in ["fg", "bg", "style"]})
 import re
 import testfuncs
 import importlib