Partial (so far unsuccessful) implementation of installer

This commit is contained in:
Cian Hughes
2023-12-18 14:54:55 +00:00
parent 642dc14f7b
commit 83876a09e4
5 changed files with 19 additions and 8 deletions

View File

@@ -2,7 +2,8 @@
name = "i-form-server-node-deployer" name = "i-form-server-node-deployer"
version = "0.1.0" version = "0.1.0"
description = "A tool for automatically deploying nodes in a cluster server for research environments." description = "A tool for automatically deploying nodes in a cluster server for research environments."
urls={github = "https://github.com/Cian-H/I-Form_Server_Node_Deployer"} repository = "https://github.com/Cian-H/I-Form_Server_Node_Deployer"
documentation = "https://i-form-node-deployer.netlify.app"
authors = ["Cian Hughes <cian.hughes@dcu.ie>"] authors = ["Cian Hughes <cian.hughes@dcu.ie>"]
readme = "README.md" readme = "README.md"
license = "MIT" license = "MIT"
@@ -12,7 +13,7 @@ packages = [
] ]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.12" python = ">=3.12,<3.13"
typer = {extras = ["all"], version = "^0.9.0"} typer = {extras = ["all"], version = "^0.9.0"}
selenium = "^4.14.0" selenium = "^4.14.0"
mechanicalsoup = "^1.3.0" mechanicalsoup = "^1.3.0"
@@ -42,10 +43,15 @@ flet = "^0.11.0"
psutil = "^5.9.6" psutil = "^5.9.6"
types-psutil = "^5.9.5.17" types-psutil = "^5.9.5.17"
[tool.poetry.group.build.dependencies]
pyinstaller = "^6.2.0"
[tool.poetry.scripts] [tool.poetry.scripts]
node_deployer = "node_deployer.__main__:main" node_deployer = "node_deployer.__main__:main"
debug_node_deployer = "node_deployer.__main__:debug" debug_node_deployer = "node_deployer.__main__:debug"
build_docs = "scripts.docs:main" build_docs = "scripts.docs:main"
build = "scripts.build:main"
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]

2
scripts/build.py Normal file
View File

@@ -0,0 +1,2 @@
def main():
pass

View File

@@ -5,6 +5,7 @@ from typing import Dict, Any
from node_deployer.config import config from node_deployer.config import config
from node_deployer import app as _cli_app from node_deployer import app as _cli_app
from node_deployer_gui import main as gui_main from node_deployer_gui import main as gui_main
from node_deployer_gui import assets_dir
cmd_params: Dict[Any, Any] = config.typer cmd_params: Dict[Any, Any] = config.typer
@@ -18,7 +19,7 @@ app = typer.Typer(
@app.command(name="gui", help="The GUI interface for the node deployer", **cmd_params) @app.command(name="gui", help="The GUI interface for the node deployer", **cmd_params)
@app.callback(invoke_without_command=True) @app.callback(invoke_without_command=True)
def gui_app(): def gui_app():
ft.app(target=gui_main) ft.app(target=gui_main, assets_dir=assets_dir)
@app.command(name="cli", help="The CLI interface for the node deployer", **cmd_params) @app.command(name="cli", help="The CLI interface for the node deployer", **cmd_params)

View File

@@ -1,3 +1,6 @@
from pathlib import Path
from .gui import main from .gui import main
__all__ = ["main"] assets_dir = str(Path(__file__).parent.absolute() / "assets")
__all__ = ["main", "assets_dir"]

View File

@@ -1,6 +1,5 @@
from collections import defaultdict from collections import defaultdict
from functools import wraps from functools import wraps
from pathlib import Path
from typing import Callable, DefaultDict, Optional, Tuple from typing import Callable, DefaultDict, Optional, Tuple
import flet as ft import flet as ft
@@ -40,9 +39,9 @@ def main(page: ft.Page) -> None:
# Lets start with the easiest part: a logo in the top left # Lets start with the easiest part: a logo in the top left
if page.platform_brightness == ft.ThemeMode.DARK: if page.platform_brightness == ft.ThemeMode.DARK:
logo = ft.Image(str(Path(__file__).parent / "assets/logo_dark.png"), width=210) logo = ft.Image(src="logo_dark.png", width=210)
else: else:
logo = ft.Image(str(Path(__file__).parent / "assets/logo_light.png"), width=210) logo = ft.Image(src="logo_light.png", width=210)
logo_container = ft.Container( logo_container = ft.Container(
content=logo, content=logo,
@@ -313,4 +312,4 @@ def main(page: ft.Page) -> None:
page.on_keyboard_event = on_key_press page.on_keyboard_event = on_key_press
page.update() # This shouldn't be necessary, but ensures the UI is rendered correctly page.update() # This shouldn't be necessary, but ensures the UI is rendered correctly