pyinstaller now working

This commit is contained in:
2026-02-21 12:15:29 +01:00
parent bcad8e760b
commit 88bd2c2787
60 changed files with 75 additions and 90 deletions

View File

@@ -1,12 +1,14 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['../../src/testium/__main__.py'],
pathex=['../../src/testium',
'../../src/testium/main_win/resources'],
binaries=[],
datas=[ ('../../src/VERSION', '.')],
datas=[ ('../../src/VERSION', '.'),
('../../src/lua_func', 'lua_func'),
('../../src/py_func', 'py_func'),
('../../src/lib', 'lib')],
hiddenimports=["git",
"interpreter",
"main_win",

0
src/lib/__init__.py Normal file
View File

View File

@@ -5,9 +5,12 @@ import threading
import itertools
from time import sleep
from typing import Callable, Any
try:
import libs.testium as tm
except:
import py_func.tm as tm
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
"""Lightweight JSON-RPC 2.0 helpers over TCP sockets.

View File

@@ -1,6 +1,6 @@
import sys
from threading import (Thread, Event)
from interpreter.utils.string_queue import StringQueue
from lib.string_queue import StringQueue
from time import (sleep)
class StdioRedirect:

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python
import multiprocessing
from py_func.tm import _init_api, _remote_print
from testium.interpreter.utils.stdout_redirect import stdio_redir
from lib.stdout_redirect import stdio_redir
class TcpStdOut:

View File

@@ -5,7 +5,7 @@ from pathlib import Path
import importlib
import traceback
from testium.interpreter.utils.tum_except import ETUMRuntimeError, ETUMSyntaxError
from lib.tum_except import ETUMRuntimeError, ETUMSyntaxError
from py_func import tm

View File

@@ -7,8 +7,8 @@ import math
import json
import traceback
from testium.interpreter.utils.jrpc import JsonRpcSrv
from testium.interpreter.utils.tum_except import ETUMRuntimeError, print_exception
from lib.jrpc import JsonRpcSrv
from lib.tum_except import ETUMRuntimeError, print_exception
import py_func.tm as tm
from py_func.func_call import func_exec

View File

@@ -1,24 +1,8 @@
"""tm — proxy module exposing remote-callable API functions.
This module dynamically exposes functions listed in
``interpreter.utils.api.SUPPORTED_API``. Each exposed function is a
thin wrapper that forwards the call to a running ``FuncHandler``
instance (stored in ``_func_call_thread``).
Typical usage:
>>> from testium.py_func import tm
>>> handler = tm._init_api(port)
>>> tm.some_api_function(args)
Only after ``_init_api`` has been called will API functions be able to
send requests to the remote handler; otherwise an ``ETUMRuntimeError``
is raised.
"""
import sys
from py_func.handle import FuncHandler
from testium.interpreter.utils.tum_except import ETUMRuntimeError
from testium.interpreter.utils.api import SUPPORTED_API
from lib.tum_except import ETUMRuntimeError
from lib.api import SUPPORTED_API
thismodule = sys.modules[__name__]
# Shared FuncHandler instance used to forward API calls. Remains None

View File

@@ -8,8 +8,8 @@ from multiprocessing import Queue
from interpreter.process import TestProcess
from interpreter.utils.test_ctrl import TestSetController
from interpreter.utils.tum_except import ETUMFileError
from interpreter.utils.stdout_redirect import stdio_redir
from lib.tum_except import ETUMFileError
from lib.stdout_redirect import stdio_redir
class Batch:

View File

@@ -1,15 +1,14 @@
import os
import sys
from multiprocessing import Process, Queue, Pipe
from queue import Empty
from threading import Thread
from time import sleep
import copy
from lib.string_queue import StringQueue
from lib.tum_except import print_exception, ETUMRuntimeError, ETUMSyntaxError
import libs.testium as tm
from interpreter.utils.params import expanse
from interpreter.utils.string_queue import StringQueue
from interpreter.utils.tum_except import ETUMRuntimeError, ETUMSyntaxError
from interpreter.utils.test_ctrl import TestSetController
from interpreter.utils.test_init import (
env_init,
@@ -25,10 +24,9 @@ from interpreter.utils.test_init import (
from interpreter.utils.constants import TestItemType as cst_type
from interpreter.test_set import TestSet
from interpreter.utils.include import TUMLoader, TUMLoaderNoIncludes, TUMLoaderRawIncludes
from interpreter.utils.stdout_redirect import stdio_redir
from lib.stdout_redirect import stdio_redir
from interpreter.utils.template import template_to_test
from interpreter.utils.yaml_load import yaml_load
from interpreter.utils.tum_except import print_exception
from interpreter.utils.py_eval import eval_process_init
from interpreter.utils.api_srv import api_request

View File

@@ -90,7 +90,7 @@ class Terminal(Cmd):
# redirect output
if 'Linux' in platform.system() and not no_color:
from interpreter.utils.stdout_redirect import stdio_redir
from lib.stdout_redirect import stdio_redir
try:
from interpreter.utils.termlog import TermLog
stdio_redir.redirect(TermLog(sys.stdout))

View File

@@ -1,4 +1,4 @@
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.test_items.test_item import TestItem, test_run, test_data
from interpreter.test_items.test_result import TestResult, TestValue
from interpreter.test_items.item_actions.action import TestItemAction

View File

@@ -7,7 +7,7 @@ import libs.testium as tm
from interpreter.utils.params import TestItemParams
from interpreter.utils.constants import TestItemType as cst_type
from interpreter.utils.eval import eval_to_boolean, evaluate, post_evaluate
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
LOG_TEST_STOP = '<----- step "{}" finished'
LOG_TEST_START = '-----> step "{}" started'

View File

@@ -1,7 +1,7 @@
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import TestValue
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
import libs.testium as tm
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.eval import evaluate

View File

@@ -4,7 +4,7 @@ from interpreter.test_items.test_item import TestItem, test_run
from interpreter.test_items.test_result import TestResult, TestValue
from interpreter.test_items.dialog_choices_files import choices_dialog
import libs.testium as tm
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.utils.constants import TestItemType as cst

View File

@@ -4,8 +4,8 @@ import importlib
import traceback
import libs.testium as tm
from interpreter.utils.tum_except import ETUMSyntaxError
from interpreter.utils.stdout_redirect import stdio_redir
from lib.tum_except import ETUMSyntaxError
from lib.stdout_redirect import stdio_redir
from interpreter.test_items.test_item import test_run
from interpreter.test_items.item_actions import TestItemActions
from interpreter.test_items.item_actions.action import TestItemAction

View File

@@ -1,6 +1,6 @@
import traceback
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
from interpreter.utils.py_func_exec import PyFuncExecEngine
from interpreter.utils.api_srv import api_request
from interpreter.test_items.test_item import TestItem, test_run

View File

@@ -1,7 +1,7 @@
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestValue)
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.tum_except import ETUMParamError, ETUMSyntaxError
from lib.tum_except import ETUMParamError, ETUMSyntaxError
import interpreter.utils.version as git
class TestItemGit(TestItem):

View File

@@ -1,7 +1,7 @@
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
import libs.testium as tm
class TestItemGroup(TestItem):

View File

@@ -7,7 +7,7 @@ from interpreter.test_items.test_result import TestResult, TestValue
from interpreter.test_items.dialog_image_files import dialog_image
import libs.testium as tm
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
class TestItemImageDialog(TestItem):

View File

@@ -2,7 +2,7 @@ import sys
import traceback
from random import randint
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.test_items.test_item import TestItem, test_run
from interpreter.test_items.test_result import TestResult, TestValue

View File

@@ -3,7 +3,7 @@ import socket
import re
import struct
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
import libs.testium as tm
from libs.console import Console

View File

@@ -5,7 +5,7 @@ import time
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
import libs.testium as tm
from interpreter.utils.constants import TestItemType as cst

View File

@@ -4,12 +4,12 @@ import traceback
import pprint
import textwrap
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
from interpreter.test_items.test_item import TestItem, test_run
from interpreter.test_items.test_result import TestValue
import libs.testium as tm
from interpreter.utils.lua_func_exec import LuaFuncExecEngine
from interpreter.utils.api_srv import api_request
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from interpreter.utils.constants import TestItemType as cst

View File

@@ -6,7 +6,7 @@ from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestValue)
from interpreter.test_items.dialog_msg_files import msg_dialog
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
class TestItemMsgDialog(TestItem):
"""dialog_message item usage.

View File

@@ -5,7 +5,7 @@ from multiprocessing import Process, Pipe
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.test_items.dialog_note_files import test_dialog
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
import libs.testium as tm
from interpreter.utils.constants import TestItemType as cst

View File

@@ -4,12 +4,12 @@ import time
import pprint
import textwrap
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
from interpreter.test_items.test_item import TestItem, test_run
from interpreter.test_items.test_result import TestValue
import libs.testium as tm
from interpreter.utils.py_func_exec import PyFuncExecEngine
from interpreter.utils.api_srv import api_request
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from interpreter.utils.constants import TestItemType as cst

View File

@@ -7,7 +7,7 @@ from PySide6.QtWidgets import QMessageBox
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.test_items.dialog_question_files import question_dialog
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.utils.constants import TestItemType as cst
class TestItemQuestionDialog(TestItem):

View File

@@ -1,7 +1,7 @@
from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestValue)
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.utils.constants import TestItemType as cst
from interpreter.test_report.test_report import Export

View File

@@ -10,7 +10,7 @@ from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestValue)
import libs.testium as tm
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
def nowInBetween(start, end):

View File

@@ -4,7 +4,7 @@ import traceback
from functools import wraps
import libs.testium as tm
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.test_items.test_item import TestItem, test_run
from interpreter.test_items.test_result import TestResult, TestValue
from interpreter.test_items.item_actions import TestItemActions

View File

@@ -7,7 +7,7 @@ from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestValue)
from interpreter.test_items.dialog_sleep_files import dialog_sleep
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
class TestItemSleep(TestItem):
"""sleep item usage.

View File

@@ -6,7 +6,7 @@ from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.test_items.tested_references_files import tested_refs_dialog
import libs.testium as tm
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.utils.constants import TestItemType as cst
class TestItemTestedRefsDialog(TestItem):

View File

@@ -5,13 +5,13 @@ from unittest import (TestCase, TestSuite, TextTestRunner,
from unittest.loader import defaultTestLoader
import libs.testium as tm
from interpreter.utils.tum_except import (ETUMFileError)
from lib.tum_except import (ETUMFileError)
from interpreter.utils.modules import load_source
from interpreter.test_items.test_item import (TestItem, test_run, LOG_TEST_STOP, LOG_TEST_START)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.test_items.test_item import test_data
from interpreter.utils.constants import TestItemType as cst
from interpreter.utils.stdout_redirect import stdio_redir
from lib.stdout_redirect import stdio_redir
class UnittestResult(TextTestResult):
"""Test result adapted for unittest test"""

View File

@@ -6,7 +6,7 @@ from interpreter.test_items.test_item import (TestItem, test_run)
from interpreter.test_items.test_result import (TestResult, TestValue)
from interpreter.test_items.dialog_value_files import test_dialog
import libs.testium as tm
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.utils.constants import TestItemType as cst
class TestItemValueDialog(TestItem):

View File

@@ -1,4 +1,4 @@
from interpreter.utils.tum_except import (ETUMRuntimeError)
from lib.tum_except import (ETUMRuntimeError)
from datetime import datetime
from enum import Enum

View File

@@ -3,8 +3,8 @@ from functools import wraps
import sqlite3
from time import (time, sleep)
import traceback
from interpreter.utils.tum_except import (ETUMRuntimeError, ETUMSyntaxError)
from interpreter.utils.stdout_redirect import stdio_redir
from lib.tum_except import (ETUMRuntimeError, ETUMSyntaxError)
from lib.stdout_redirect import stdio_redir
from interpreter.utils.params import (expanse)
from interpreter.utils.paths import prepare_file_to_save
import interpreter.utils.constants as cst

View File

@@ -3,14 +3,14 @@ import datetime
from queue import Queue
from interpreter.utils.params import expanse
import libs.testium as tm
from interpreter.utils.tum_except import (
from lib.tum_except import (
ETUMSyntaxError,
)
import interpreter.utils.settings as prefs
from interpreter.test_report.test_report import TestReport
from interpreter.utils.py_func_exec import PyFuncExecEngine
from interpreter.utils.api_srv import api_request
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
from interpreter.utils.constants import TestItemType as cst_type
import interpreter.utils.constants as cst
from interpreter.utils.constants import TEST_TYPE_LIST

View File

@@ -1,4 +1,4 @@
from interpreter.utils.api import SUPPORTED_API
from lib.api import SUPPORTED_API
import libs.testium as tm

View File

@@ -1,6 +1,6 @@
import libs.testium as tm
from interpreter.utils.py_eval import eval_exec
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
def evaluate(val, **replacement_dict):

View File

@@ -2,7 +2,7 @@ import yaml
import os.path
import libs.testium as tm
from interpreter.utils.params import expanse
from interpreter.utils.tum_except import ETUMFileError
from lib.tum_except import ETUMFileError
from interpreter.utils.template import template_to_test
from copy import copy
from interpreter.utils.globdict import global_dict

View File

@@ -1,6 +1,6 @@
from interpreter.utils.lua_process import LuaProcessBase
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
from interpreter.test_items.test_result import TestValue

View File

@@ -5,9 +5,9 @@ import subprocess
import socket
import libs.testium as tm
from lib.jrpc import JsonRpcClient
from interpreter.utils.paths import subproc_path
from interpreter.utils.tum_except import ETUMRuntimeError
from interpreter.utils.jrpc import JsonRpcClient
from lib.tum_except import ETUMRuntimeError
from interpreter.utils.paths import sys_app_path_lin, sys_app_path_win
def _lua_version(path: str):

View File

@@ -1,5 +1,5 @@
import interpreter.utils.globdict as globdict
from interpreter.utils.tum_except import ETUMSyntaxError, ETUMRuntimeError
from lib.tum_except import ETUMSyntaxError, ETUMRuntimeError
glob_eval_func = None

View File

@@ -12,7 +12,6 @@ def testium_path():
if getattr(sys, 'frozen', False):
# Exécuté depuis le .exe
print(f"Path: {sys._MEIPASS}")
return sys._MEIPASS
tp = inspect.getfile(inspect.getmodule(testium))
@@ -21,7 +20,6 @@ def testium_path():
def subproc_path():
if getattr(sys, 'frozen', False):
# Exécuté depuis le .exe
print(f"Path: {sys._MEIPASS}")
return sys._MEIPASS
tp = inspect.getfile(inspect.getmodule(testium))

View File

@@ -1,5 +1,5 @@
from interpreter.utils.py_process import PyProcessBase
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
import libs.testium as tm

View File

@@ -1,6 +1,6 @@
from interpreter.utils.py_process import PyProcessBase
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
from interpreter.test_items.test_result import TestValue

View File

@@ -3,10 +3,10 @@ import shutil
import sys
import subprocess
import socket
from lib.jrpc import JsonRpcClient
import libs.testium as tm
from interpreter.utils.paths import sys_app_path_lin, sys_app_path_win
from interpreter.utils.tum_except import ETUMRuntimeError
from interpreter.utils.jrpc import JsonRpcClient
from lib.tum_except import ETUMRuntimeError
from interpreter.utils.paths import testium_path, subproc_path

View File

@@ -2,7 +2,7 @@ import os
import configparser
import json
import platform
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
SettingsCompany = 'Testium'
SettingsApplication = 'testium'

View File

@@ -4,7 +4,7 @@ from jinja2 import Template
from jinja2.exceptions import TemplateSyntaxError, TemplateError, UndefinedError
from tempfile import TemporaryFile
from interpreter.utils.yaml_load import print_yaml
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
def template_to_test(filename: str, params: list):

View File

@@ -1,6 +1,6 @@
from multiprocessing import Queue
from queue import Empty
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
class TestSetController:

View File

@@ -13,7 +13,7 @@ import interpreter.utils.settings as prefs
from interpreter.utils.paths import testium_path
from interpreter.utils.yaml_load import yaml_load
from interpreter.utils import clear_recursively
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
from interpreter.utils.params import expanse, eval_func_init
from interpreter.utils.eval import evaluate
from interpreter.utils.version import (

View File

@@ -2,7 +2,7 @@ from yaml.parser import ParserError
from yaml import load, Loader
from yaml.scanner import ScannerError
from libs.testium import print_debug
from interpreter.utils.tum_except import ETUMSyntaxError
from lib.tum_except import ETUMSyntaxError
import io

View File

@@ -18,7 +18,7 @@ from datetime import datetime, timedelta, timezone
import libs.testium as tm
from interpreter.test_items.test_result import TestValue
from interpreter.utils.tum_except import ETUMRuntimeError
from lib.tum_except import ETUMRuntimeError
from interpreter.utils.py_func_exec import PyFuncExecEngine
from interpreter.utils.api_srv import api_request
from interpreter.utils.eval import post_evaluate

View File

@@ -4,7 +4,7 @@ import sys
import textwrap
from time import monotonic
import interpreter.utils.globdict as globdict
from interpreter.utils.tum_except import (ETUMSyntaxError)
from lib.tum_except import (ETUMSyntaxError)
###############################################################################
# Console helper functions

View File

@@ -10,7 +10,7 @@ from PySide6.QtGui import (QFont, QFontInfo)
from time import (time)
from main_win.test_tree_items.common import (TEST_COLS, TEST_COLS_WITH_TIME)
from interpreter.utils.tum_except import (ETUMFileError, ETUMSyntaxError)
from lib.tum_except import (ETUMFileError, ETUMSyntaxError)
from interpreter.utils.test_ctrl import TestSetController
from main_win.test_tree_items.test_tree_git import QTestTreeItemGit

View File

@@ -36,7 +36,7 @@ from main_win.f1_win.d_f1_win import DialogF1
from main_win.test_tree import QTestTree
from main_win.test_run.thread_output import ThreadTestOutput
from interpreter.utils.string_queue import StringQueue
from lib.string_queue import StringQueue
from interpreter.process import TestProcess
from interpreter.utils.test_ctrl import TestSetController
from interpreter.utils.icons import icon_prefix
@@ -44,14 +44,14 @@ from interpreter.utils.icons import icon_prefix
from main_win.test_run.outlog import OutLog
from main_win.test_run.test_run import ThreadTestStatus
import interpreter.utils.settings as prefs
from interpreter.utils.stdout_redirect import stdio_redir
from lib.stdout_redirect import stdio_redir
import libs.testium as tm
from interpreter.utils.version import get_testium_version
from interpreter.utils.test_init import (
env_init,
locate_report_file,
)
from interpreter.utils.tum_except import ETUMFileError, ETUMRuntimeError
from lib.tum_except import ETUMFileError, ETUMRuntimeError
class MainWindow(QMainWindow, Ui_MainWindow):