From b8463b2cd8a792fbc47abe54617e19b9da75ba6b Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Tue, 7 May 2024 12:20:09 +0200 Subject: [PATCH] ci(pyinstaller): add hatch config and documentation to build the app using PyInstaller --- docs/development.md | 10 ++++++++++ pyproject.toml | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/docs/development.md b/docs/development.md index ea17612..5ddabdd 100644 --- a/docs/development.md +++ b/docs/development.md @@ -115,3 +115,13 @@ hatch clean ``` This command will remove the `dist` directory. + +## Building the binary distribution + +➢ To build the binary distribution, run: + +```shell +hatch run pyinstaller:build +``` + +This command will run PyInstaller and generate a standalone executable in the `dist` directory. diff --git a/pyproject.toml b/pyproject.toml index 8b17c4e..eb5cbea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,12 @@ build = "mkdocs build -f mkdocs.yml {args}" serve = "mkdocs serve -f mkdocs.yml {args}" gh-deploy = "mkdocs gh-deploy -f mkdocs.yml {args}" +[tool.hatch.envs.pyinstaller] +detached = true +dependencies = ["pyinstaller"] + +[tool.hatch.envs.pyinstaller.scripts] +build = "pyinstaller --name AntaresWebInstaller --onefile src/antares_web_installer/__main__.py" [tool.mypy] mypy_path = 'src, tests'