Skip to content

Commit

Permalink
setup: Remove imports of PyInstaller at top-level.
Browse files Browse the repository at this point in the history
These are only used if our command `build_bootloader` is used. Move it in
there to avoid the need to import PyInstaller.
  • Loading branch information
htgoebel committed Feb 3, 2020
1 parent 606bec4 commit 28799aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

# Hack required to allow compat to not fail when pypiwin32 isn't found
os.environ["PYINSTALLER_NO_PYWIN32_FAILURE"] = "1"
from PyInstaller import HOMEPATH, PLATFORM
from PyInstaller.compat import is_win, is_cygwin


#-- plug-in building the bootloader

Expand All @@ -36,6 +35,8 @@ def finalize_options(self): pass

def bootloader_exists(self):
# Checks is the console, non-debug bootloader exists
from PyInstaller import HOMEPATH, PLATFORM
from PyInstaller.compat import is_win, is_cygwin
exe = 'run'
if is_win or is_cygwin:
exe = 'run.exe'
Expand All @@ -44,6 +45,7 @@ def bootloader_exists(self):

def compile_bootloader(self):
import subprocess
from PyInstaller import HOMEPATH

src_dir = os.path.join(HOMEPATH, 'bootloader')
cmd = [sys.executable, './waf', 'configure', 'all']
Expand Down

0 comments on commit 28799aa

Please sign in to comment.