diff options
author | Florian Bruhin <git@the-compiler.org> | 2017-02-17 14:11:45 +0100 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2017-02-17 14:42:57 +0100 |
commit | a86170f45dbc56b62f33709f33a258a077afe6f4 (patch) | |
tree | 3aaf1063d7c2112d1d5e917fe67a98f3ab4016e4 /scripts/link_pyqt.py | |
parent | 7a4a34c3747f1647b3e8b652e48358cb42dbbd41 (diff) | |
download | qutebrowser-a86170f45dbc56b62f33709f33a258a077afe6f4.tar.gz qutebrowser-a86170f45dbc56b62f33709f33a258a077afe6f4.zip |
Drop PyQt < 5.7.1 support for QtWebEngine
Diffstat (limited to 'scripts/link_pyqt.py')
-rw-r--r-- | scripts/link_pyqt.py | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/scripts/link_pyqt.py b/scripts/link_pyqt.py index c93449b47..fffe27fb3 100644 --- a/scripts/link_pyqt.py +++ b/scripts/link_pyqt.py @@ -154,15 +154,6 @@ def link_pyqt(executable, venv_path): copy_or_link(path, dest) -def patch_pypi_pyqt(venv_path): - executable = get_venv_executable(venv_path) - pyqt_dir = os.path.dirname(get_lib_path(executable, 'PyQt5.QtCore')) - qt_conf = os.path.join(pyqt_dir, 'Qt', 'libexec', 'qt.conf') - with open(qt_conf, 'w', encoding='utf-8') as f: - f.write('[Paths]\n') - f.write('Prefix = ..\n') - - def copy_or_link(source, dest): """Copy or symlink source to dest.""" if os.name == 'nt': @@ -186,15 +177,11 @@ def remove(filename): os.unlink(filename) -def get_venv_executable(path): - """Get the Python executable in a virtualenv.""" - subdir = 'Scripts' if os.name == 'nt' else 'bin' - return os.path.join(path, subdir, 'python') - - def get_venv_lib_path(path): """Get the library path of a virtualenv.""" - return run_py(get_venv_executable(path), + subdir = 'Scripts' if os.name == 'nt' else 'bin' + executable = os.path.join(path, subdir, 'python') + return run_py(executable, 'from distutils.sysconfig import get_python_lib', 'print(get_python_lib())') @@ -213,19 +200,15 @@ def main(): parser.add_argument('path', help="Base path to the venv.") parser.add_argument('--tox', help="Add when called via tox.", action='store_true') - parser.add_argument('--pypi', help="Patch a PyPI-installed PyQt 5.6", - action='store_true') args = parser.parse_args() - if args.pypi: - patch_pypi_pyqt(args.path) + if args.tox: + executable = get_tox_syspython(args.path) else: - if args.tox: - executable = get_tox_syspython(args.path) - else: - executable = sys.executable - venv_path = get_venv_lib_path(args.path) - link_pyqt(executable, venv_path) + executable = sys.executable + + venv_path = get_venv_lib_path(args.path) + link_pyqt(executable, venv_path) if __name__ == '__main__': |