Python lint: Use flake8 --extend-ignore instead of --ignore (#1498)

This commit is contained in:
Christian Clauss
2024-12-07 00:20:31 +01:00
committed by GitHub
parent b644e2e6bb
commit 095c488961
9 changed files with 27 additions and 68 deletions

View File

@@ -62,10 +62,10 @@ def main(args):
branch_name = 'version_' + new_version
if is_github_runner: # For GitHub Actions workflows
if is_github_runner: # For GitHub Actions workflows
with open(os.environ['GITHUB_ENV'], 'a') as f:
f.write(f'RELEASE_VERSION={new_version}')
else: # Local use
else: # Local use
# Create a new git branch
subprocess.check_call(['git', 'checkout', '-b', branch_name, 'origin/main'], cwd=root_dir)

View File

@@ -8,12 +8,14 @@ import sys
EMSCRIPTEN_RELEASES_GIT = 'https://chromium.googlesource.com/emscripten-releases'
TAGFILE = 'emscripten-releases-tags.json'
def get_latest_hash(tagfile):
with open(tagfile) as f:
versions = json.load(f)
latest = versions['aliases']['latest']
return versions['releases'][latest]
def get_latest_emscripten(tagfile):
latest = get_latest_hash(tagfile)
if not os.path.isdir('emscripten-releases'):
@@ -30,6 +32,7 @@ def get_latest_emscripten(tagfile):
if len(tokens) and tokens[0] == 'emscripten':
return tokens[2]
if __name__ == '__main__':
emscripten_hash = get_latest_emscripten(TAGFILE)
print('Emscripten revision ' + emscripten_hash)

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env python3
import json
import os
import sys
def get_latest(tagfile):
with open(tagfile) as f:
versions = json.load(f)

View File

@@ -45,8 +45,6 @@ pywin32_base = 'https://github.com/mhammond/pywin32/releases/download/b%s/' % py
upload_base = 'gs://webassembly/emscripten-releases-builds/deps/'
def make_python_patch():
pywin32_filename = 'pywin32-%s.win-amd64-py%s.exe' % (pywin32_version, major_minor_version)
filename = 'python-%s-amd64.zip' % (version)

View File

@@ -1,5 +1,6 @@
import os
def unzip_cmd():
# Use 7-Zip if available (https://www.7-zip.org/)
sevenzip = os.path.join(os.getenv('ProgramFiles', ''), '7-Zip', '7z.exe')