diff options
author | Axel Dahlberg <git@valleymnt.com> | 2021-03-03 05:07:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 05:07:00 -0800 |
commit | 7db764f0950f04fe044d5187713738d116fbf702 (patch) | |
tree | e97ba568d8bd3d71d830cd97c6fe581a582434ed /scripts | |
parent | 82ba01647b9000b5422f6f77e874acdf4f5a511d (diff) | |
parent | 9909bf0b113b1357bb19c678046a14762b2b6901 (diff) | |
download | qutebrowser-7db764f0950f04fe044d5187713738d116fbf702.tar.gz qutebrowser-7db764f0950f04fe044d5187713738d116fbf702.zip |
Merge branch 'master' into feature/6109-file-picker-stdout
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dev/build_release.py | 23 | ||||
-rw-r--r-- | scripts/dev/ci/docker/Dockerfile.j2 | 7 | ||||
-rw-r--r-- | scripts/dev/misc_checks.py | 26 | ||||
-rw-r--r-- | scripts/dev/recompile_requirements.py | 22 | ||||
-rwxr-xr-x | scripts/dev/run_vulture.py | 8 |
5 files changed, 75 insertions, 11 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 060e9ba59..5f739a4dd 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -143,6 +143,23 @@ def smoke_test(executable): raise Exception("Unexpected stderr:\n{}".format(stderr)) +def patch_windows_exe(exe_path): + """Make sure the Windows .exe has a correct checksum. + + WORKAROUND for https://github.com/pyinstaller/pyinstaller/issues/5579 + """ + import pefile + pe = pefile.PE(exe_path) + + # If this fails, a PyInstaller upgrade fixed things, and we can remove the + # workaround. Would be a good idea to keep the check, though. + assert not pe.verify_checksum() + + pe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum() + pe.close() + pe.write(exe_path) + + def patch_mac_app(): """Patch .app to use our Info.plist and save some space.""" app_path = os.path.join('dist', 'qutebrowser.app') @@ -280,9 +297,13 @@ def _build_windows_single(*, x64, skip_packaging): out_pyinstaller = os.path.join('dist', 'qutebrowser') shutil.move(out_pyinstaller, outdir) + exe_path = os.path.join(outdir, 'qutebrowser.exe') + + utils.print_title(f"Patching {human_arch} exe") + patch_windows_exe(exe_path) utils.print_title(f"Running {human_arch} smoke test") - smoke_test(os.path.join(outdir, 'qutebrowser.exe')) + smoke_test(exe_path) if skip_packaging: return [] diff --git a/scripts/dev/ci/docker/Dockerfile.j2 b/scripts/dev/ci/docker/Dockerfile.j2 index d3fc82793..03e5684ad 100644 --- a/scripts/dev/ci/docker/Dockerfile.j2 +++ b/scripts/dev/ci/docker/Dockerfile.j2 @@ -1,5 +1,12 @@ FROM archlinux:latest +# WORKAROUND for glibc 2.33 and old Docker +# See https://github.com/actions/virtual-environments/issues/2658 +# Thanks to https://github.com/lxqt/lxqt-panel/pull/1562 +RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \ + curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \ + bsdtar -C / -xvf "$patched_glibc" + {% if unstable %} RUN sed -i '/^# after the header/a[kde-unstable]\nInclude = /etc/pacman.d/mirrorlist\n\n[testing]\nInclude = /etc/pacman.d/mirrorlist' /etc/pacman.conf {% endif %} diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py index f66081dbf..91baec926 100644 --- a/scripts/dev/misc_checks.py +++ b/scripts/dev/misc_checks.py @@ -143,10 +143,11 @@ def _check_spelling_file(path, fobj, patterns): ok = True for num, line in enumerate(fobj, start=1): for pattern, explanation in patterns: - if pattern.search(line): + match = pattern.search(line) + if match: ok = False print(f'{path}:{num}: ', end='') - utils.print_col(f'Found "{pattern.pattern}" - {explanation}', 'blue') + utils.print_col(f'Found "{match.group(0)}" - {explanation}', 'blue') return ok @@ -175,6 +176,23 @@ def check_spelling(args: argparse.Namespace) -> Optional[bool]: "Common misspelling or non-US spelling" ) for w in words ] + + qtbot_methods = { + 'keyPress', + 'keyRelease', + 'keyClick', + 'keyClicks', + 'keyEvent', + 'mousePress', + 'mouseRelease', + 'mouseClick', + 'mouseMove', + 'mouseDClick', + 'keySequence', + } + + qtbot_excludes = '|'.join(qtbot_methods) + patterns += [ ( re.compile(r'(?i)# noqa(?!: )'), @@ -226,6 +244,10 @@ def check_spelling(args: argparse.Namespace) -> Optional[bool]: re.compile(r'IOError'), "use OSError", ), + ( + re.compile(fr'qtbot\.(?!{qtbot_excludes})[a-z]+[A-Z].*'), + "use snake-case instead", + ) ] # Files which should be ignored, e.g. because they come from another diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index c4ab7cff1..cafb393aa 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -74,7 +74,7 @@ CHANGELOG_URLS = { 'snowballstemmer': 'https://github.com/snowballstem/snowball/blob/master/NEWS', 'virtualenv': 'https://virtualenv.pypa.io/en/latest/changelog.html', 'packaging': 'https://packaging.pypa.io/en/latest/changelog.html', - 'build': 'https://github.com/pypa/build/commits/master', + 'build': 'https://github.com/pypa/build/blob/main/CHANGELOG.rst', 'attrs': 'https://www.attrs.org/en/stable/changelog.html', 'Jinja2': 'https://github.com/pallets/jinja/blob/master/CHANGES.rst', 'MarkupSafe': 'https://markupsafe.palletsprojects.com/en/1.1.x/changes/', @@ -95,7 +95,7 @@ CHANGELOG_URLS = { 'pep8-naming': 'https://github.com/PyCQA/pep8-naming/blob/master/CHANGELOG.rst', 'pycodestyle': 'https://github.com/PyCQA/pycodestyle/blob/master/CHANGES.txt', 'pyflakes': 'https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst', - 'cffi': 'https://cffi.readthedocs.io/en/latest/whatsnew.html', + 'cffi': 'https://github.com/python-cffi/release-doc/blob/master/doc/source/whatsnew.rst', 'astroid': 'https://github.com/PyCQA/astroid/blob/2.4/ChangeLog', 'pytest-instafail': 'https://github.com/pytest-dev/pytest-instafail/blob/master/CHANGES.rst', 'coverage': 'https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst', @@ -137,10 +137,12 @@ CHANGELOG_URLS = { 'cryptography': 'https://cryptography.io/en/latest/changelog.html', 'toml': 'https://github.com/uiri/toml/releases', 'PyQt5': 'https://www.riverbankcomputing.com/news', + 'PyQt5-Qt': 'https://www.riverbankcomputing.com/news', 'PyQtWebEngine': 'https://www.riverbankcomputing.com/news', + 'PyQtWebEngine-Qt': 'https://www.riverbankcomputing.com/news', 'PyQt-builder': 'https://www.riverbankcomputing.com/news', 'PyQt5-sip': 'https://www.riverbankcomputing.com/news', - 'PyQt5_stubs': 'https://github.com/stlehmann/PyQt5-stubs/blob/master/CHANGELOG.md', + 'PyQt5-stubs': 'https://github.com/stlehmann/PyQt5-stubs/blob/master/CHANGELOG.md', 'sip': 'https://www.riverbankcomputing.com/news', 'Pygments': 'https://pygments.org/docs/changelog/', 'vulture': 'https://github.com/jendrikseipp/vulture/blob/master/CHANGELOG.md', @@ -153,10 +155,8 @@ CHANGELOG_URLS = { 'tldextract': 'https://github.com/john-kurkowski/tldextract/blob/master/CHANGELOG.md', 'typing-extensions': 'https://github.com/python/typing/commits/master/typing_extensions', 'diff-cover': 'https://github.com/Bachmann1234/diff_cover/blob/master/CHANGELOG', - 'pytest-clarity': 'https://github.com/darrenburns/pytest-clarity/commits/master', 'pytest-icdiff': 'https://github.com/hjwp/pytest-icdiff/blob/master/HISTORY.rst', 'icdiff': 'https://github.com/jeffkaufman/icdiff/blob/master/ChangeLog', - 'termcolor': 'https://pypi.org/project/termcolor/', 'pprintpp': 'https://github.com/wolever/pprintpp/blob/master/CHANGELOG.txt', 'beautifulsoup4': 'https://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/view/head:/CHANGELOG', 'check-manifest': 'https://github.com/mgedmin/check-manifest/blob/master/CHANGES.rst', @@ -175,10 +175,14 @@ CHANGELOG_URLS = { 'pyroma': 'https://github.com/regebro/pyroma/blob/master/HISTORY.txt', 'adblock': 'https://github.com/ArniDagur/python-adblock/blob/master/CHANGELOG.md', 'importlib-resources': 'https://importlib-resources.readthedocs.io/en/latest/history.html', + 'importlib-metadata': 'https://github.com/python/importlib_metadata/blob/main/CHANGES.rst', + 'zipp': 'https://github.com/jaraco/zipp/blob/main/CHANGES.rst', 'dataclasses': 'https://github.com/ericvsmith/dataclasses#release-history', 'pip': 'https://pip.pypa.io/en/stable/news/', 'wheel': 'https://wheel.readthedocs.io/en/stable/news.html', 'setuptools': 'https://setuptools.readthedocs.io/en/latest/history.html', + 'future': 'https://python-future.org/whatsnew.html', + 'pefile': 'https://github.com/erocarrera/pefile/commits/master', } @@ -370,10 +374,12 @@ def parse_versioned_line(line): if '==' in line: if line[0] == '#': # ignored dependency line = line[1:].strip() - line = line.rsplit('#', maxsplit=1)[0] # Strip comments + + # Strip comments and pip environment markers + line = line.rsplit('#', maxsplit=1)[0] + line = line.split(';')[0].strip() + name, version = line.split('==') - if ';' in version: # pip environment markers - version = version.split(';')[0].strip() elif line.startswith('-e'): rest, name = line.split('#egg=') version = rest.split('@')[1][:7] diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py index 3728e9ecb..e229b2782 100755 --- a/scripts/dev/run_vulture.py +++ b/scripts/dev/run_vulture.py @@ -116,6 +116,7 @@ def whitelist_generator(): # noqa: C901 for attr in ['_get_default_metavar_for_optional', '_get_default_metavar_for_positional', '_metavar_formatter']: yield 'scripts.dev.src2asciidoc.UsageFormatter.' + attr + yield 'scripts.dev.build_release.pefile.PE.OPTIONAL_HEADER.CheckSum' for dist in version.Distribution: yield 'qutebrowser.utils.version.Distribution.{}'.format(dist.name) @@ -139,6 +140,13 @@ def whitelist_generator(): # noqa: C901 yield 'ParserDictType' yield 'qutebrowser.config.configutils.Values._VmapKeyType' + # ELF + yield 'qutebrowser.misc.elf.Endianness.big' + for name in ['phoff', 'ehsize', 'phentsize', 'phnum']: + yield f'qutebrowser.misc.elf.Header.{name}' + for name in ['addr', 'addralign', 'entsize']: + yield f'qutebrowser.misc.elf.SectionHeader.{name}' + def filter_func(item): """Check if a missing function should be filtered or not. |