diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 98ba8b07de..43594538aa 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -27,7 +27,7 @@ jobs: with: python-version: '3.10' - name: Install wpiformat - run: pip3 install wpiformat==2024.34 + run: pip3 install wpiformat==2024.38 - name: Run run: wpiformat - name: Check output @@ -66,7 +66,7 @@ jobs: with: python-version: '3.10' - name: Install wpiformat - run: pip3 install wpiformat==2024.34 + run: pip3 install wpiformat==2024.38 - name: Create compile_commands.json run: | ./gradlew generateCompileCommands -Ptoolchain-optional-roboRio diff --git a/apriltag/convert_apriltag_layouts.py b/apriltag/convert_apriltag_layouts.py index b89f666cf3..75d1f143cb 100755 --- a/apriltag/convert_apriltag_layouts.py +++ b/apriltag/convert_apriltag_layouts.py @@ -21,7 +21,6 @@ import json import os from wpimath import geometry, units -import numpy as np def main(): diff --git a/ntcore/generate_topics.py b/ntcore/generate_topics.py index 81b1f83a45..ae3d779ab1 100755 --- a/ntcore/generate_topics.py +++ b/ntcore/generate_topics.py @@ -3,10 +3,8 @@ import argparse import json import sys from pathlib import Path -from typing import Dict, Any from jinja2 import Environment, FileSystemLoader -from jinja2.environment import Template def Output(output_dir: Path, controller_name: str, contents: str): diff --git a/upstream_utils/eigen.py b/upstream_utils/eigen.py index ace408ecb0..577e55f50b 100755 --- a/upstream_utils/eigen.py +++ b/upstream_utils/eigen.py @@ -130,6 +130,7 @@ def main(): name = "eigen" url = "https://gitlab.com/libeigen/eigen.git" tag = "c4d84dfddc9f9edef0fdbe7cf9966d2f4a303198" + patch_list = [ "0001-Disable-warnings.patch", "0002-Intellisense-fix.patch", diff --git a/upstream_utils/expected.py b/upstream_utils/expected.py index 08569e3561..ed2b9d24eb 100755 --- a/upstream_utils/expected.py +++ b/upstream_utils/expected.py @@ -1,17 +1,9 @@ #!/usr/bin/env python3 import os -import re import shutil -from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, - walk_cwd_and_copy_if, - git_am, - Lib, -) +from upstream_utils import Lib def copy_upstream_src(wpilib_root): diff --git a/upstream_utils/fmt.py b/upstream_utils/fmt.py index 8f03859f54..5c2f5fe787 100755 --- a/upstream_utils/fmt.py +++ b/upstream_utils/fmt.py @@ -4,11 +4,7 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, walk_cwd_and_copy_if, - git_am, Lib, ) @@ -24,26 +20,17 @@ def copy_upstream_src(wpilib_root): shutil.rmtree(os.path.join(wpiutil, d), ignore_errors=True) # Copy fmt source files into allwpilib - src_files = walk_cwd_and_copy_if( + walk_cwd_and_copy_if( lambda dp, f: dp.startswith("./src") and f.endswith(".cc") and f != "fmt.cc", os.path.join(wpiutil, "src/main/native/thirdparty/fmtlib"), ) # Copy fmt header files into allwpilib - include_files = walk_cwd_and_copy_if( + walk_cwd_and_copy_if( lambda dp, f: dp.startswith("./include/fmt"), os.path.join(wpiutil, "src/main/native/thirdparty/fmtlib"), ) - for f in src_files: - comment_out_invalid_includes( - f, [os.path.join(wpiutil, "src/main/native/thirdparty/fmtlib/include")] - ) - for f in include_files: - comment_out_invalid_includes( - f, [os.path.join(wpiutil, "src/main/native/thirdparty/fmtlib/include")] - ) - def main(): name = "fmt" diff --git a/upstream_utils/gcem.py b/upstream_utils/gcem.py index b6fd472a72..61dbbe87e3 100755 --- a/upstream_utils/gcem.py +++ b/upstream_utils/gcem.py @@ -4,11 +4,7 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, walk_cwd_and_copy_if, - git_am, Lib, ) @@ -23,16 +19,11 @@ def copy_upstream_src(wpilib_root): shutil.rmtree(os.path.join(wpimath, d), ignore_errors=True) # Copy gcem include files into allwpilib - include_files = walk_cwd_and_copy_if( + walk_cwd_and_copy_if( lambda dp, f: dp.startswith("./include"), os.path.join(wpimath, "src/main/native/thirdparty/gcem"), ) - for f in include_files: - comment_out_invalid_includes( - f, [os.path.join(wpimath, "src/main/native/thirdparty/gcem/include")] - ) - def main(): name = "gcem" diff --git a/upstream_utils/googletest.py b/upstream_utils/googletest.py index b39c96da52..9706b8b556 100755 --- a/upstream_utils/googletest.py +++ b/upstream_utils/googletest.py @@ -69,9 +69,7 @@ def main(): url = "https://github.com/google/googletest.git" tag = "v1.14.0" - patch_list = [] - - googletest = Lib(name, url, tag, patch_list, copy_upstream_src) + googletest = Lib(name, url, tag, [], copy_upstream_src) googletest.main() diff --git a/upstream_utils/json.py b/upstream_utils/json.py index 78924ef2a1..23766cdff1 100755 --- a/upstream_utils/json.py +++ b/upstream_utils/json.py @@ -4,10 +4,7 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, walk_if, - git_am, Lib, ) diff --git a/upstream_utils/libuv.py b/upstream_utils/libuv.py index 73ba5f6830..4cb025f632 100755 --- a/upstream_utils/libuv.py +++ b/upstream_utils/libuv.py @@ -4,11 +4,7 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, walk_cwd_and_copy_if, - git_am, Lib, ) @@ -27,7 +23,7 @@ def copy_upstream_src(wpilib_root): "sunos.h", ] - include_files = walk_cwd_and_copy_if( + walk_cwd_and_copy_if( lambda dp, f: dp.startswith("./include") and f not in include_ignorelist, os.path.join(wpinet, "src/main/native/thirdparty/libuv"), ) @@ -48,7 +44,7 @@ def copy_upstream_src(wpilib_root): "sysinfo-loadavg.c", "sysinfo-memory.c", ] - src_files = walk_cwd_and_copy_if( + walk_cwd_and_copy_if( lambda dp, f: dp.startswith("./src") and f not in src_ignorelist, os.path.join(wpinet, "src/main/native/thirdparty/libuv"), rename_c_to_cpp=True, diff --git a/upstream_utils/llvm.py b/upstream_utils/llvm.py index abbc077a65..67bad0032c 100755 --- a/upstream_utils/llvm.py +++ b/upstream_utils/llvm.py @@ -3,14 +3,7 @@ import os import shutil -from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, - walk_cwd_and_copy_if, - git_am, - Lib, -) +from upstream_utils import Lib def run_global_replacements(wpiutil_llvm_files): diff --git a/upstream_utils/memory.py b/upstream_utils/memory.py index 4a61858422..2aa1d2de9d 100755 --- a/upstream_utils/memory.py +++ b/upstream_utils/memory.py @@ -4,9 +4,6 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, walk_if, copy_to, Lib, diff --git a/upstream_utils/mpack.py b/upstream_utils/mpack.py index e0971f3079..f49c3a1db1 100755 --- a/upstream_utils/mpack.py +++ b/upstream_utils/mpack.py @@ -5,10 +5,7 @@ import shutil import subprocess from upstream_utils import ( - get_repo_root, - clone_repo, walk_cwd_and_copy_if, - git_am, Lib, ) diff --git a/upstream_utils/protobuf.py b/upstream_utils/protobuf.py index 8b2adf5347..1b0cba26de 100755 --- a/upstream_utils/protobuf.py +++ b/upstream_utils/protobuf.py @@ -4,13 +4,8 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, copy_to, - walk_cwd_and_copy_if, walk_if, - git_am, Lib, ) diff --git a/upstream_utils/sleipnir.py b/upstream_utils/sleipnir.py index 11b20cc29a..f4cd1b8b2e 100755 --- a/upstream_utils/sleipnir.py +++ b/upstream_utils/sleipnir.py @@ -4,11 +4,7 @@ import os import shutil from upstream_utils import ( - get_repo_root, - clone_repo, copy_to, - walk_cwd_and_copy_if, - git_am, Lib, ) diff --git a/upstream_utils/stack_walker.py b/upstream_utils/stack_walker.py index 190f12d04d..5b5c2634db 100755 --- a/upstream_utils/stack_walker.py +++ b/upstream_utils/stack_walker.py @@ -4,14 +4,7 @@ import os import shutil import subprocess -from upstream_utils import ( - get_repo_root, - clone_repo, - comment_out_invalid_includes, - walk_cwd_and_copy_if, - git_am, - Lib, -) +from upstream_utils import Lib def crlf_to_lf(): diff --git a/wpiutil/examples/printlog/datalog.py b/wpiutil/examples/printlog/datalog.py index 0f725fd17b..5bc50cc5b2 100755 --- a/wpiutil/examples/printlog/datalog.py +++ b/wpiutil/examples/printlog/datalog.py @@ -287,7 +287,7 @@ if __name__ == "__main__": if data.entry in entries: print("...DUPLICATE entry ID, overriding") entries[data.entry] = data - except TypeError as e: + except TypeError: print("Start(INVALID)") elif record.isFinish(): try: @@ -297,7 +297,7 @@ if __name__ == "__main__": print("...ID not found") else: del entries[entry] - except TypeError as e: + except TypeError: print("Finish(INVALID)") elif record.isSetMetadata(): try: @@ -305,7 +305,7 @@ if __name__ == "__main__": print(f"SetMetadata({data.entry}, '{data.metadata}') [{timestamp}]") if data.entry not in entries: print("...ID not found") - except TypeError as e: + except TypeError: print("SetMetadata(INVALID)") elif record.isControl(): print("Unrecognized control record") @@ -349,5 +349,5 @@ if __name__ == "__main__": elif entry.type == "string[]": arr = record.getStringArray() print(f" {arr}") - except TypeError as e: + except TypeError: print(" invalid")