From 234a88bec663d628f7b03847e710eb6bd5bc1d8b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 15 Nov 2015 15:52:02 +0100 Subject: [PATCH] avoid hidden import, make it easy for pyinstaller this fixes #218 in an easier way so one doesn't have to type --hidden-import=logging.config all the time when using pyinstaller. --- Vagrantfile | 2 +- borg/logger.py | 4 ++++ docs/development.rst | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 02b43c91e..dbb73f377 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -237,7 +237,7 @@ def build_binary_with_pyinstaller(boxname) cd /vagrant/borg . borg-env/bin/activate cd borg - pyinstaller -F -n borg.exe --distpath=/vagrant/borg --clean --hidden-import=logging.config borg/__main__.py + pyinstaller -F -n borg.exe --distpath=/vagrant/borg --clean borg/__main__.py EOF end diff --git a/borg/logger.py b/borg/logger.py index 6c5d2ff81..2d4b49bc1 100644 --- a/borg/logger.py +++ b/borg/logger.py @@ -33,6 +33,10 @@ import inspect import logging +# make it easy for PyInstaller (it does not discover the dependency on this +# module automatically, because it is lazy-loaded by logging, see #218): +import logging.config + def setup_logging(stream=None): """setup logging module according to the arguments provided diff --git a/docs/development.rst b/docs/development.rst index 23f28385a..f51ea414c 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -129,7 +129,7 @@ When using the Vagrant VMs, pyinstaller will already be installed. With virtual env activated:: pip install pyinstaller>=3.0 # or git checkout master - pyinstaller -F -n borg-PLATFORM --hidden-import=logging.config borg/__main__.py + pyinstaller -F -n borg-PLATFORM borg/__main__.py for file in dist/borg-*; do gpg --armor --detach-sign $file; done If you encounter issues, see also our `Vagrantfile` for details.