Skip to content

Commit 012b13e

Browse files
authored
Merge pull request #349 from tekktrik/dev/fix-daily-release
Dev/fix-daily-release
2 parents b417f43 + 97f29e6 commit 012b13e

14 files changed

+494
-614
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
exclude: patches
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.0.1
8+
rev: v4.4.0
99
hooks:
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
1212
- repo: https://github.com/fsfe/reuse-tool
13-
rev: v0.12.1
13+
rev: v1.1.2
1414
hooks:
1515
- id: reuse
1616
- repo: https://github.com/psf/black
17-
rev: 22.3.0
17+
rev: 23.3.0
1818
hooks:
1919
- id: black
2020
- repo: https://github.com/pycqa/pylint
21-
rev: v2.9.3
21+
rev: v2.17.4
2222
hooks:
2323
- id: pylint
2424
name: pylint

.pylintrc

Lines changed: 478 additions & 269 deletions
Large diffs are not rendered by default.

LICENSES/CC-BY-4.0.txt

Lines changed: 0 additions & 324 deletions
This file was deleted.

adabot/circuitpython_bundle.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def update_download_stats(bundle_path):
113113
with open(
114114
os.path.join(bundle_path, "circuitpython_library_pypi_stats.md"), "w"
115115
) as md_file:
116-
117116
# Write headers
118117
md_file.write("\n".join(lib_list_header))
119118
md_file.write("\n")
@@ -285,6 +284,7 @@ def update_bundle(bundle_path):
285284
status = StringIO()
286285
git.status("--short", _out=status)
287286
updates = []
287+
release_required = False
288288
status = status.getvalue().strip()
289289
if status:
290290
for status_line in status.split("\n"):
@@ -305,6 +305,7 @@ def update_bundle(bundle_path):
305305
url = repo_remote_url(directory)
306306
summary = "\n".join(diff_lines[1:-1])
307307
updates.append((url[:-4], old_commit, new_commit, summary))
308+
release_required = True
308309
os.chdir(working_directory)
309310
lib_list_updates = check_lib_links_md(bundle_path)
310311
if lib_list_updates:
@@ -321,6 +322,7 @@ def update_bundle(bundle_path):
321322
),
322323
)
323324
)
325+
release_required = True
324326
if update_download_stats(bundle_path):
325327
updates.append(
326328
(
@@ -334,7 +336,7 @@ def update_bundle(bundle_path):
334336
)
335337
)
336338

337-
return updates
339+
return updates, release_required
338340

339341

340342
def commit_updates(bundle_path, update_info):
@@ -546,9 +548,9 @@ def new_release(bundle, bundle_path):
546548
bundle_dir = os.path.join(bundles_dir, cp_bundle)
547549
try:
548550
fetch_bundle(cp_bundle, bundle_dir)
549-
updates_needed = update_bundle(bundle_dir)
550-
if updates_needed:
551-
commit_updates(bundle_dir, updates_needed)
551+
updates, release_required = update_bundle(bundle_dir)
552+
if release_required:
553+
commit_updates(bundle_dir, updates)
552554
push_updates(bundle_dir)
553555
new_release(cp_bundle, bundle_dir)
554556
except RuntimeError as e:

adabot/circuitpython_libraries.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"Adafruit_Python_Extended_Bus",
9494
]
9595

96+
9697
# pylint: disable=too-many-locals, too-many-branches, too-many-statements
9798
def run_library_checks(validators, kw_args, error_depth):
9899
"""runs the various library checking functions"""

adabot/lib/circuitpython_library_validators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def uses_token(func):
198198
return func
199199

200200

201+
# pylint: disable=too-many-instance-attributes
201202
class LibraryValidator:
202203
"""Class to hold instance variables needed to traverse the calling
203204
code, and the validator functions.
@@ -367,7 +368,6 @@ def _filter_file_diffs(filenames):
367368
".pre-commit-config.yaml",
368369
".pylintrc",
369370
".gitignore",
370-
"CODE_OF_CONDUCT.md",
371371
"README.rst",
372372
"pyproject.toml",
373373
}
@@ -414,7 +414,6 @@ def _filter_file_diffs(filenames):
414414
compare_tags_json = compare_tags.json()
415415
if "status" in compare_tags_json:
416416
if compare_tags_json["status"] != "identical":
417-
418417
filtered_files = _filter_file_diffs(
419418
[file["filename"] for file in compare_tags_json.get("files")]
420419
)

tests/integration/test_circuitpython_libraries.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from adabot.lib import circuitpython_library_validators
1414

15+
1516
# pylint: disable=unused-argument
1617
def mock_list_repos(*args, **kwargs):
1718
"""Function to monkeypatch `common_funcs.list_repos()` for a shorter set of repos."""

tests/integration/test_update_cp_org_libraries.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from adabot import github_requests
1313
from adabot import update_cp_org_libraries
1414

15+
1516
# pylint: disable=unused-argument
1617
def mock_list_repos(*args, **kwargs):
1718
"""Function to monkeypatch `common_funcs.list_repos()` for a shorter set of repos."""

tools/ci_status.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ def save_build_statuses(
295295

296296

297297
if __name__ == "__main__":
298-
299298
parser = argparse.ArgumentParser(
300299
description="Check the CI status of the Bundle libraries"
301300
)

tools/docs_status.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def check_docs_statuses(
106106

107107

108108
if __name__ == "__main__":
109-
110109
parser = argparse.ArgumentParser(
111110
description="Check the RTD docs build status of the Bundle libraries"
112111
)

0 commit comments

Comments
 (0)