Skip to content

Commit fbfccb9

Browse files
authored
Merge pull request #885 from nathanchance/update-python-linting
Python linting updates and fixes
2 parents 2f17d5e + 858534b commit fbfccb9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
version: ['3.11', '3.10', '3.9', '3.8']
35+
version: ['3.14', '3.13', '3.12', '3.11', '3.10']
3636
uses: ClangBuiltLinux/actions-workflows/.github/workflows/python_lint.yml@main
3737
with:
3838
python_version: ${{ matrix.version }}

caching/check.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
OWNER = "ClangBuiltLinux"
4444
REPO = "continuous-integration2"
4545
MAIN_BRANCH = "main"
46-
HEADERS = {} # populated after args are parsed
46+
headers = {} # populated after args are parsed
4747

4848
# states we allow our cache system to perform a cache-hit upon
4949
# other states like 'presuite' or 'unknown' or '' (empty) are considered
@@ -94,7 +94,7 @@ def ___purge___cache___():
9494
"""!!!completely clears the CBL CI cache!!!"""
9595
list_url = f"https://api.github.com/repos/{OWNER}/{REPO}/actions/variables"
9696

97-
list_response = requests.get(list_url, headers=HEADERS, timeout=TIMEOUT)
97+
list_response = requests.get(list_url, headers=headers, timeout=TIMEOUT)
9898
print(list_response.content)
9999
all_variables_keys = [
100100
x["name"] for x in json.loads(list_response.content)["variables"]
@@ -106,7 +106,7 @@ def ___purge___cache___():
106106
f"https://api.github.com/repos/{OWNER}/{REPO}/actions/variables/{key}"
107107
)
108108
delete_response = requests.delete(delete_url,
109-
headers=HEADERS,
109+
headers=headers,
110110
timeout=TIMEOUT)
111111
if delete_response.status_code != 204:
112112
print(f"ERROR: Couldn't delete cache entry with key {key}")
@@ -136,7 +136,7 @@ def get_clang_version():
136136
def get_repository_variable_or_none(name: str) -> Optional[dict]:
137137
_url = f"https://api.github.com/repos/{OWNER}/{REPO}/actions/variables/{name}"
138138

139-
response = requests.get(_url, headers=HEADERS, timeout=TIMEOUT)
139+
response = requests.get(_url, headers=headers, timeout=TIMEOUT)
140140
if response.status_code != 200:
141141
return None
142142

@@ -156,14 +156,14 @@ def create_repository_variable(name: str, linux_sha: str, clang_version: str,
156156
})
157157
data = {"name": name, "value": _value}
158158

159-
resp = requests.post(_url, headers=HEADERS, json=data, timeout=TIMEOUT)
159+
resp = requests.post(_url, headers=headers, json=data, timeout=TIMEOUT)
160160
print(f"create_repository_variable() response:\n{resp.content}")
161161

162162

163163
if __name__ == "__main__":
164164
args = parse_args()
165165

166-
HEADERS = {
166+
headers = {
167167
"Accept": "application/vnd.github+json",
168168
"Authorization": f"Bearer {args.github_token}",
169169
"X-GitHub-Api-Version": "2022-11-28",
@@ -228,7 +228,7 @@ def create_repository_variable(name: str, linux_sha: str, clang_version: str,
228228
""")
229229
update_repository_variable(
230230
VAR_NAME,
231-
http_headers=HEADERS,
231+
http_headers=headers,
232232
sha=curr_sha,
233233
clang_version=curr_clang_version,
234234
patches_hash=curr_patches_hash,

0 commit comments

Comments
 (0)