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