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"
version = "0.1.0"
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>"]
readme = "README.md"
license = "MIT"
@@ -12,7 +13,7 @@ packages = [
]
[tool.poetry.dependencies]
python = "^3.12"
python = ">=3.12,<3.13"
typer = {extras = ["all"], version = "^0.9.0"}
selenium = "^4.14.0"
mechanicalsoup = "^1.3.0"
@@ -42,10 +43,15 @@ flet = "^0.11.0"
psutil = "^5.9.6"
types-psutil = "^5.9.5.17"
[tool.poetry.group.build.dependencies]
pyinstaller = "^6.2.0"
[tool.poetry.scripts]
node_deployer = "node_deployer.__main__:main"
debug_node_deployer = "node_deployer.__main__:debug"
build_docs = "scripts.docs:main"
build = "scripts.build:main"
[build-system]
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 import app as _cli_app
from node_deployer_gui import main as gui_main
from node_deployer_gui import assets_dir
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.callback(invoke_without_command=True)
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)

View File

@@ -1,3 +1,6 @@
from pathlib import Path
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 functools import wraps
from pathlib import Path
from typing import Callable, DefaultDict, Optional, Tuple
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
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:
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(
content=logo,