|
14 | 14 | Execute Spyder from source checkout.
|
15 | 15 | """
|
16 | 16 |
|
17 |
| -# pylint: disable=C0103 |
18 |
| -# pylint: disable=C0412 |
19 |
| -# pylint: disable=C0413 |
20 |
| - |
21 | 17 | # Standard library imports
|
22 | 18 | import argparse
|
23 | 19 | import os
|
|
28 | 24 | from logging import Formatter, StreamHandler, getLogger
|
29 | 25 | from pathlib import Path
|
30 | 26 |
|
| 27 | +# Local imports |
31 | 28 | from install_dev_repos import DEVPATH, REPOS, install_repo
|
32 | 29 |
|
| 30 | + |
| 31 | +# ============================================================================= |
33 | 32 | # ---- Setup logger
|
| 33 | +# ============================================================================= |
34 | 34 | fmt = Formatter('%(asctime)s [%(levelname)s] [%(name)s] -> %(message)s')
|
35 | 35 | h = StreamHandler()
|
36 | 36 | h.setFormatter(fmt)
|
|
40 | 40 |
|
41 | 41 | time_start = time.time()
|
42 | 42 |
|
43 |
| -# ---- Parse command line |
44 | 43 |
|
| 44 | +# ============================================================================= |
| 45 | +# ---- Parse command line |
| 46 | +# ============================================================================= |
45 | 47 | parser = argparse.ArgumentParser(
|
46 | 48 | usage="python bootstrap.py [options] [-- spyder_options]",
|
47 | 49 | epilog="""\
|
|
72 | 74 | assert args.gui in (None, 'pyqt5', 'pyside2'), \
|
73 | 75 | "Invalid GUI toolkit option '%s'" % args.gui
|
74 | 76 |
|
| 77 | + |
| 78 | +# ============================================================================= |
75 | 79 | # ---- Install sub repos
|
| 80 | +# ============================================================================= |
76 | 81 | installed_dev_repo = False
|
77 | 82 | if not args.no_install:
|
78 | 83 | prev_branch = None
|
|
121 | 126 | original_sys_argv = sys.argv.copy()
|
122 | 127 | sys.argv = [sys.argv[0]] + args.spyder_options
|
123 | 128 |
|
124 |
| -# ---- Update os.environ |
125 | 129 |
|
| 130 | +# ============================================================================= |
| 131 | +# ---- Update os.environ |
| 132 | +# ============================================================================= |
126 | 133 | # Store variable to be used in self.restart (restart Spyder instance)
|
127 | 134 | os.environ['SPYDER_BOOTSTRAP_ARGS'] = str(original_sys_argv[1:])
|
128 | 135 |
|
|
158 | 165 | logger.info("Skipping GUI toolkit detection")
|
159 | 166 | os.environ['QT_API'] = args.gui
|
160 | 167 |
|
161 |
| -# ---- Check versions |
162 | 168 |
|
| 169 | +# ============================================================================= |
| 170 | +# ---- Check versions |
| 171 | +# ============================================================================= |
163 | 172 | # Checking versions (among other things, this has the effect of setting the
|
164 | 173 | # QT_API environment variable if this has not yet been done just above)
|
165 | 174 | versions = get_versions(reporev=True)
|
|
175 | 184 | sys.exit("ERROR: Your qtpy version is outdated. Please install qtpy "
|
176 | 185 | "1.1.0 or higher to be able to work with Spyder!")
|
177 | 186 |
|
178 |
| -# ---- Execute Spyder |
179 | 187 |
|
| 188 | +# ============================================================================= |
| 189 | +# ---- Execute Spyder |
| 190 | +# ============================================================================= |
180 | 191 | if args.hide_console and os.name == 'nt':
|
181 | 192 | logger.info("Hiding parent console (Windows only)")
|
182 | 193 | sys.argv.append("--hide-console") # Windows only: show parent console
|
|
0 commit comments