From 4f76ad144f166e73b49621eba1d8b0a43bfe43d7 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 13 Jan 2025 21:53:51 +0000 Subject: [PATCH] Improve pyproject.toml --- microkodi/main.py | 7 +++++-- pyproject.toml | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/microkodi/main.py b/microkodi/main.py index 1aa4d74..d8ff12a 100644 --- a/microkodi/main.py +++ b/microkodi/main.py @@ -59,7 +59,7 @@ def run_kodi_server(): httpd.serve_forever() logger.info("Shutting down server") -if __name__ == "__main__": +def main(): parser = argparse.ArgumentParser() parser.add_argument("--config", "-c", type=Path, help="Location of the config file") parser.add_argument("--debug", action="store_true", default=False) @@ -97,4 +97,7 @@ if __name__ == "__main__": engine.rootObjects()[0].setProperty("bridge", bridge) exit_code = app.exec() del engine - sys.exit(exit_code) \ No newline at end of file + sys.exit(exit_code) + +if __name__ == '__main__': + main() diff --git a/pyproject.toml b/pyproject.toml index a004d08..6d2790b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,22 @@ version = "0.1.0" dependencies = [ "pyside6", "requests", - "yt-dlp", "cec" ] +requires-python = ">= 3.11" + +[project.optional-dependencies] +youtube = [ + "yt-dlp" +] +dev = [ + "mypy", + "black", + "ruff" +] + +[project.scripts] +microkodi = "microkodi.main:main" [tool.setuptools.packages.find] exclude = ["contrib"] \ No newline at end of file