From c51361d5370107fee35c1fd82abd8e802f7d077b Mon Sep 17 00:00:00 2001 From: Louchart Sebastien Date: Tue, 17 Oct 2023 08:52:42 +0200 Subject: [PATCH] fix(pyinstaller): add a datafile from cookiecutter to the binary bundle of pyInstaller --- ddb.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ddb.spec b/ddb.spec index bddba1c..1af1704 100644 --- a/ddb.spec +++ b/ddb.spec @@ -2,12 +2,21 @@ block_cipher = None +# since version 2.2.3, cookiecutter comes with a VERSION.txt file that needs to be included +# as a datafile. This is kind of a temporary hack until a PR for cookiecutter is accepted +# to turn this VERSION.txt file into a regular Python module. + +import cookiecutter +from pathlib import Path +COOKIECUTTER_PATH = Path(cookiecutter.__file__).parent.resolve() + a = Analysis(['ddb/__main__.py'], pathex=[], binaries=[], datas=[ - ('ddb/feature/jsonnet/lib/*', 'ddb/feature/jsonnet/lib') + ('ddb/feature/jsonnet/lib/*', 'ddb/feature/jsonnet/lib'), + (str(COOKIECUTTER_PATH / 'VERSION.txt'), 'cookiecutter'), ], hiddenimports=[ 'ddb.feature.jsonnet.docker',