MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / main

Function main

scripts/sysinstall.py:115–420  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114
115def main():
116
117 if 1:
118 log(f'## {__file__}: Starting.')
119 log(f'{sys.executable=}')
120 log(f'{platform.python_version()=}')
121 log(f'{__file__=}')
122 log(f'{os.environ.get("PYMUDF_SCRIPTS_SYSINSTALL_ARGS_PRE")=}')
123 log(f'{os.environ.get("PYMUDF_SCRIPTS_SYSINSTALL_ARGS_POST")=}')
124 log(f'{sys.argv=}')
125 log(f'{sysconfig.get_path("platlib")=}')
126 run_command(f'python -V', check=0)
127 run_command(f'python3 -V', check=0)
128 run_command(f'sudo python -V', check=0)
129 run_command(f'sudo python3 -V', check=0)
130 run_command(f'sudo PATH={os.environ["PATH"]} python -V', check=0)
131 run_command(f'sudo PATH={os.environ["PATH"]} python3 -V', check=0)
132
133 if test_py.github_workflow_unimportant():
134 return
135
136 # Set default behaviour.
137 #
138 gdb = False
139 use_installer = True
140 mupdf_do = True
141 mupdf_dir = 'mupdf'
142 mupdf_git = None
143 mupdf_so_mode = None
144 packages = True
145 prefix = '/usr/local'
146 pymupdf_do = True
147 root = 'pymupdf-sysinstall-test-root'
148 tesseract5 = True
149 pytest_args = None
150 pytest_do = True
151 pytest_name = None
152 test_venv = 'venv-pymupdf-sysinstall-test'
153 pip = 'venv'
154 test_fitz = '1'
155 test_implementations = 'rR'
156
157 # Parse command-line.
158 #
159 env_args_pre = shlex.split(os.environ.get('PYMUDF_SCRIPTS_SYSINSTALL_ARGS_PRE', ''))
160 env_args_post = shlex.split(os.environ.get('PYMUDF_SCRIPTS_SYSINSTALL_ARGS_POST', ''))
161 args = iter(env_args_pre + sys.argv[1:] + env_args_post)
162 while 1:
163 try:
164 arg = next(args)
165 except StopIteration:
166 break
167 if arg in ('-h', '--help'):
168 log(__doc__)
169 return
170 elif arg == '--gdb': gdb = int(next(args))
171 elif arg == '--mupdf-do': mupdf_do = int(next(args))
172 elif arg == '--mupdf-dir': mupdf_dir = next(args)

Callers 1

sysinstall.pyFile · 0.70

Calls 5

run_commandFunction · 0.85
runFunction · 0.70
logFunction · 0.50
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…