diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4da257..e35cfd1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,10 @@ jobs: awk -F '\/' '{ print tolower($2) }' | tr '_' '-' ) - - name: Set up Python 3.6 + - name: Set up Python 3.7 uses: actions/setup-python@v1 with: - python-version: 3.6 + python-version: 3.7 - name: Versions run: | python3 --version diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f16a239..5fc6e2e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: - repo: https://github.com/python/black - rev: 21.6b0 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/fsfe/reuse-tool diff --git a/adafruit_shell.py b/adafruit_shell.py index c90149c..c39f23c 100644 --- a/adafruit_shell.py +++ b/adafruit_shell.py @@ -125,7 +125,7 @@ class Shell: if message is None: self.error("Exiting due to error") else: - self.error("Exiting due to error: {}".format(message)) + self.error(f"Exiting due to error: {message}") sys.exit(1) def error(self, message): @@ -257,9 +257,7 @@ class Shell: Run the grep command and return the result """ location = self.path(location) - return self.run_command( - "grep {} {}".format(search_term, location), suppress_message=True - ) + return self.run_command(f"grep {search_term} {location}", suppress_message=True) @staticmethod def date(): @@ -385,7 +383,7 @@ class Shell: """ if not self.is_root(): print("Installer must be run as root.") - print("Try 'sudo python3 {}'".format(self.script())) + print(f"Try 'sudo python3 {self.script()}'") sys.exit(1) def write_text_file(self, path, content, append=True): @@ -516,7 +514,7 @@ class Shell: def check_kernel_update_reboot_required(self): """Checks if the pi needs to be rebooted since the last kernel update""" - if not self.exists("/lib/modules/{}".format(self.release())): + if not self.exists(f"/lib/modules/{self.release()}"): self.error( "OS has not been rebooted since last kernel update. " "Please reboot and re-run the script." diff --git a/docs/conf.py b/docs/conf.py index 2cd6eb4..dbeb600 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,13 +21,6 @@ extensions = [ "sphinx.ext.todo", ] -# TODO: Please Read! -# Uncomment the below if you use native CircuitPython modules such as -# digitalio, micropython and busio. List the modules you use. Without it, the -# autodoc module docs will fail to generate with a warning. -# autodoc_mock_imports = ["digitalio", "busio"] - - intersphinx_mapping = { "python": ("https://docs.python.org/3.4", None), "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None), @@ -60,7 +53,7 @@ release = "1.0" # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files.