-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyinstaller.py
37 lines (28 loc) · 1.23 KB
/
pyinstaller.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This file is part of D-EcoImpact
# Copyright (C) 2022-2024 Stichting Deltares
# This program is free software distributed under the
# GNU Affero General Public License version 3.0
# A copy of the GNU Affero General Public License can be found at
# https://github.com/Deltares/D-EcoImpact/blob/main/LICENSE.md
"""Main script for creating executable based on Python source files"""
from pathlib import Path
import PyInstaller.__main__ # pylint: disable=import-error, no-name-in-module
# MDK: thess warnings are disabled on purpose. Using PyInstaller.__main__
# comes directly from the documentation of PyInstaller.
HERE = Path(__file__).parent.absolute()
PATH_TO_MAIN = str(HERE / "main.py")
def install():
"""Function to create self-contained executable out of python files.
Function can be called from command line using a poetry function.
Contains settings for pyinstaller."""
# MDK: this warning is disabled on purpose. Using PyInstaller.__main__
# comes directly from the documentation of PyInstaller.
# pylint: disable=maybe-no-member
PyInstaller.__main__.run(
[
PATH_TO_MAIN,
"--name=decoimpact",
"--console",
# other pyinstaller options...
]
)