Include Python3 in the Windows installer

Yu Jin technikmagma at gmail.com
Fri Mar 10 21:21:53 UTC 2023


Am Mi., 8. März 2023 um 14:49 Uhr schrieb Pavel Sanda:

>
> Another approach could be just collect all import lines from
> all scripts in lib/scripts and check they are within that minimal
> p3 install.
>
This sounds like a good idea, I just did that, there are quite a few
imports:

import os, re, subprocess, sys
import sys
from lyxpreview_tools import error, find_exe_or_terminate, run_command
from __future__ import print_function
import os, re, sys
import csv, unicodedata
import os, sys
import optparse
import subprocess
import os
import os.path
import re
import shutil
import sys
from __future__ import print_function
import glob
import os
import shutil
import sys
import tempfile
import zipfile
from io import open  # Required for Python 2.
import getopt, os, shutil, sys
from lyxpreview_tools import error
from __future__ import print_function
import sys,string,os
from __future__ import print_function
import os, sys
import shutil
import re
from __future__ import print_function
import os, sys, re
from __future__ import print_function
import os, sys
from subprocess import Popen, PIPE
from sys import argv, stderr, exit
import shutil
import os, string, sys, re
from lyxpreview_tools import error, run_command
from __future__ import print_function
import sys, os
import os, re, sys
import argparse
import glob, os, pipes, re, sys, tempfile
from lyxpreview_tools import check_latex_log, copyfileobj, error,
filter_pages, find_exe, find_exe_or_terminate, join_metrics_and_rename,
latex_commands, latex_file_re, make_texcolor, pdflatex_commands, progress,
run_command, run_latex, warning, write_metrics_info
from __future__ import print_function
import sys, string
from __future__ import print_function
import gzip, os, re, sys
from getopt import getopt
from io import BytesIO
from shutil import copyfile
from tempfile import NamedTemporaryFile
import zipfile
import tarfile
from ctypes import WINFUNCTYPE, windll, POINTER, byref, c_int
from ctypes.wintypes import LPWSTR, LPCWSTR
import getopt, os, sys, subprocess
import os, re, subprocess, sys, tempfile
import pywintypes
import win32con
import win32event
import win32file
import win32pipe
import win32process
import win32security
import winerror
from __future__ import print_function
import getopt, glob, os, re, shutil, sys, tempfile
import lyxpreview_tools
from legacy_lyxpreview2ppm import extract_resolution,
legacy_conversion_step1
from lyxpreview_tools import bibtex_commands, check_latex_log, copyfileobj,
error, filter_pages, find_exe, find_exe_or_terminate,
join_metrics_and_rename, latex_commands, latex_file_re, make_texcolor,
pdflatex_commands, progress, run_command, run_latex, run_tex, warning,
write_metrics_info
import sys, re
import re
from __future__ import print_function
import os, re, string, sys
from getopt import getopt
import io
from prefs2prefs_lfuns import conversions
from prefs2prefs_prefs import conversions
import re
import sys
import subprocess
from __future__ import print_function
import os, sys, re, subprocess
from __future__ import print_function
import os, sys, re, subprocess
import os, string, sys
from lyxpreview_tools import error
from __future__ import print_function
import os, sys, re

a lot of those probably dupes, but there are also imports from lyx custom
modules, do I just ignore those? If so this is what the python command
prompt returns if I just paste all those imports (removed all lines
containing 'lyx') in it:
>>> import os, re, subprocess, sys
>>> import sys
>>> from __future__ import print_function
>>> import os, re, sys
>>> import csv, unicodedata
>>> import os, sys
>>> import optparse
>>> import subprocess
>>> import os
>>> import os.path
>>> import re
>>> import shutil
>>> import sys
>>> from __future__ import print_function
>>> import glob
>>> import os
>>> import shutil
>>> import sys
>>> import tempfile
>>> import zipfile
>>> from io import open
>>> import getopt, os, shutil, sys
>>> from __future__ import print_function
>>> import sys,string,os
>>> from __future__ import print_function
>>> import os, sys
>>> import shutil
>>> import re
>>> from __future__ import print_function
>>> import os, sys, re
>>> from __future__ import print_function
>>> import os, sys
>>> from subprocess import Popen, PIPE
>>> from sys import argv, stderr, exit
>>> import shutil
>>> import os, string, sys, re
>>> from __future__ import print_function
>>> import sys, os
>>> import os, re, sys
>>> import argparse
>>> import glob, os, pipes, re, sys, tempfile
<stdin>:1: DeprecationWarning: 'pipes' is deprecated and slated for removal
in Python 3.13
>>> from __future__ import print_function
>>> import sys, string
>>> from __future__ import print_function
>>> import gzip, os, re, sys
>>> from getopt import getopt
>>> from io import BytesIO
>>> from shutil import copyfile
>>> from tempfile import NamedTemporaryFile
>>> import zipfile
>>> import tarfile
>>> from ctypes import WINFUNCTYPE, windll, POINTER, byref, c_int
>>> from ctypes.wintypes import LPWSTR, LPCWSTR
>>> import getopt, os, sys, subprocess
>>> import os, re, subprocess, sys, tempfile
>>> import pywintypes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pywintypes'
>>> import win32con
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32con'
>>> import win32event
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32event'
>>> import win32file
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32file'
>>> import win32pipe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32pipe'
>>> import win32process
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32process'
>>> import win32security
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32security'
>>> import winerror
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'winerror'
>>> from __future__ import print_function
>>> import getopt, glob, os, re, shutil, sys, tempfile
>>> import sys, re
>>> import re
>>> from __future__ import print_function
>>> import os, re, string, sys
>>> from getopt import getopt
>>> import io
>>> from prefs2prefs_lfuns import conversions
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'prefs2prefs_lfuns'
>>> from prefs2prefs_prefs import conversions
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'prefs2prefs_prefs'
>>> import re
>>> import sys
>>> import subprocess
>>> from __future__ import print_function
>>> import os, sys, re, subprocess
>>> from __future__ import print_function
>>> import os, sys, re, subprocess
>>> import os, string, sys
>>> from __future__ import print_function
>>> import os, sys, re

all the win* imports from lyxpreview_tools.py fail, but those are in a
try-except block
prefs2prefs imports also fail, but looks like prefs2prefs.py is also part
of lyx?
Otherwise the rest succeeds (1 deprecation warning), so I'd assume the
windows embeddable package is usable for lyx. I'll still test some
basic reconfigure functionality and convert a few image formats in a vm
first, and if I don't come across any problems and get no objections on
this topic here, I'll just use it in the next release/beta.
-- 
  Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230310/88916bfa/attachment.html>


More information about the lyx-devel mailing list