Python fixes from ruff check (#1641)

This commit is contained in:
Sam Clegg
2025-12-15 09:57:48 -08:00
committed by GitHub
parent b2436aafa7
commit 11ea2ee53d
7 changed files with 137 additions and 61 deletions

View File

@@ -9,9 +9,10 @@ import hashlib
import json
import os
import re
import requests
import sys
import requests
STORAGE_URL = 'https://storage.googleapis.com/webassembly/emscripten-releases-builds'
EMSDK_ROOT = os.path.dirname(os.path.dirname(__file__))
@@ -51,7 +52,7 @@ def revisions_item(version, latest_hash):
def insert_revision(item):
with open(BAZEL_REVISIONS_FILE, 'r') as f:
with open(BAZEL_REVISIONS_FILE) as f:
lines = f.readlines()
lines.insert(lines.index('EMSCRIPTEN_TAGS = {\n') + 1, item)
@@ -61,7 +62,7 @@ def insert_revision(item):
def update_module_version(version):
with open(BAZEL_MODULE_FILE, 'r') as f:
with open(BAZEL_MODULE_FILE) as f:
content = f.read()
pattern = r'(module\(\s*name = "emsdk",\s*version = )"\d+.\d+.\d+",\n\)'
@@ -74,7 +75,7 @@ def update_module_version(version):
f.write(content)
def main(argv):
def main():
version, latest_hash = get_latest_info()
update_module_version(version)
item = revisions_item(version, latest_hash)
@@ -84,4 +85,4 @@ def main(argv):
if __name__ == '__main__':
sys.exit(main(sys.argv))
sys.exit(main())

View File

@@ -11,11 +11,12 @@ For the windows version we also alter the directory layout to add the 'bin'
directory.
"""
import urllib.request
import subprocess
import sys
import os
import shutil
import subprocess
import sys
import urllib.request
from zip import unzip_cmd, zip_cmd
# When adjusting this version, visit

View File

@@ -26,10 +26,11 @@ import glob
import multiprocessing
import os
import platform
import urllib.request
import shutil
import sys
import urllib.request
from subprocess import check_call
from zip import unzip_cmd, zip_cmd
version = '3.13.3'