From 73227e7f5cfbacda6753fa37703ede59ad8d9367 Mon Sep 17 00:00:00 2001 From: Santi Date: Wed, 29 May 2024 22:27:17 +0100 Subject: [PATCH] improved upload to pypi --- src/upload_to_pypi.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/upload_to_pypi.py b/src/upload_to_pypi.py index 942cf5e43..24d83fd24 100755 --- a/src/upload_to_pypi.py +++ b/src/upload_to_pypi.py @@ -10,6 +10,28 @@ from GridCal.__version__ import __GridCal_VERSION__ from GridCalServer.__version__ import __GridCalServer_VERSION__ from gridcal_packaging import publish +from GridCal.Gui.update_gui_common import convert_resource_file, convert_ui_file + + +def update_gui_to_make_sure(): + # pyrcc5 icons.qrc -o icons_rc.py + # pyuic5 -x MainWindow.ui -o MainWindow.py + + rcc_cmd = 'pyside6-rcc' + uic_cmd = 'pyside6-uic' + + if os.name == 'nt': + rcc_cmd += '.exe' + uic_cmd += '.exe' + + # define the path to MAIN + __here__ = os.path.abspath(os.path.dirname(__file__)) + path = os.path.join(__here__, 'GridCal', 'Gui', 'Main') + + convert_resource_file(source=os.path.join(path, 'icons.qrc'), rcc_cmd=rcc_cmd) + + for f in ['MainWindow.ui', 'ConsoleLog.ui']: + convert_ui_file(source=os.path.join(path, f), uic_cmd=uic_cmd) def check_versions() -> bool: @@ -26,6 +48,8 @@ def check_versions() -> bool: if __name__ == "__main__": + update_gui_to_make_sure() + if check_versions(): _long_description = "# GridCal \n"