From b35851f2b7c1f6b3b3d7eff7006a5c9734550658 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:29:32 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bootstrap/bootstrap.py | 1 + integration-tests/plugins/simplest/tljh_simplest.py | 1 + integration-tests/test_bootstrap.py | 1 + integration-tests/test_proxy.py | 1 + integration-tests/test_simplest_plugin.py | 1 + tests/conftest.py | 1 + tests/test_conda.py | 1 + tests/test_installer.py | 1 + tests/test_migrator.py | 1 + tests/test_normalize.py | 1 + tests/test_traefik.py | 1 + tests/test_user.py | 1 + tljh/apt.py | 1 + tljh/conda.py | 1 + tljh/hooks.py | 1 + tljh/log.py | 1 + tljh/normalize.py | 1 + tljh/systemd.py | 1 + tljh/traefik.py | 1 + tljh/user.py | 1 + tljh/utils.py | 1 + tljh/yaml.py | 1 + 22 files changed, 22 insertions(+) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index ac520394d..f69aceb8d 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -42,6 +42,7 @@ can also pass a branch name such as 'main' or a commit hash. """ + import logging import multiprocessing import os diff --git a/integration-tests/plugins/simplest/tljh_simplest.py b/integration-tests/plugins/simplest/tljh_simplest.py index 015b50407..ff433f85f 100644 --- a/integration-tests/plugins/simplest/tljh_simplest.py +++ b/integration-tests/plugins/simplest/tljh_simplest.py @@ -1,6 +1,7 @@ """ Simplest plugin that exercises all the hooks defined in tljh/hooks.py. """ + from tljh.hooks import hookimpl diff --git a/integration-tests/test_bootstrap.py b/integration-tests/test_bootstrap.py index 09ae14051..eac9c9232 100644 --- a/integration-tests/test_bootstrap.py +++ b/integration-tests/test_bootstrap.py @@ -9,6 +9,7 @@ first two could be more like unit tests. Ideally, this file is significantly reduced. """ + import concurrent.futures import os import subprocess diff --git a/integration-tests/test_proxy.py b/integration-tests/test_proxy.py index cc9d76622..e1d376cb5 100644 --- a/integration-tests/test_proxy.py +++ b/integration-tests/test_proxy.py @@ -1,4 +1,5 @@ """tests for the proxy""" + import os import shutil import ssl diff --git a/integration-tests/test_simplest_plugin.py b/integration-tests/test_simplest_plugin.py index 96eb0a507..9c2337b34 100644 --- a/integration-tests/test_simplest_plugin.py +++ b/integration-tests/test_simplest_plugin.py @@ -2,6 +2,7 @@ Test the plugin in integration-tests/plugins/simplest that makes use of all tljh recognized plugin hooks that are defined in tljh/hooks.py. """ + import os import subprocess diff --git a/tests/conftest.py b/tests/conftest.py index cf765b9e5..106d53457 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """pytest fixtures""" + import os import types from importlib import reload diff --git a/tests/test_conda.py b/tests/test_conda.py index 6d445955f..397499e01 100644 --- a/tests/test_conda.py +++ b/tests/test_conda.py @@ -1,6 +1,7 @@ """ Test conda commandline wrappers """ + import os import subprocess import tempfile diff --git a/tests/test_installer.py b/tests/test_installer.py index 07081e40b..f06bb6ec7 100644 --- a/tests/test_installer.py +++ b/tests/test_installer.py @@ -1,6 +1,7 @@ """ Unit test functions in installer.py """ + import json import os from subprocess import PIPE, run diff --git a/tests/test_migrator.py b/tests/test_migrator.py index 87275f6bf..91821a870 100644 --- a/tests/test_migrator.py +++ b/tests/test_migrator.py @@ -1,6 +1,7 @@ """ Unit test functions in installer.py """ + import os from datetime import date diff --git a/tests/test_normalize.py b/tests/test_normalize.py index fe7c6236a..d408c3fbc 100644 --- a/tests/test_normalize.py +++ b/tests/test_normalize.py @@ -1,6 +1,7 @@ """ Test functions for normalizing various kinds of values """ + from tljh.normalize import generate_system_username diff --git a/tests/test_traefik.py b/tests/test_traefik.py index f95026623..9b0c8f8cb 100644 --- a/tests/test_traefik.py +++ b/tests/test_traefik.py @@ -1,4 +1,5 @@ """Test traefik configuration""" + import os import pytest diff --git a/tests/test_user.py b/tests/test_user.py index 5bda68da9..148e1740b 100644 --- a/tests/test_user.py +++ b/tests/test_user.py @@ -1,6 +1,7 @@ """ Test wrappers in tljw.user module """ + import grp import os import os.path diff --git a/tljh/apt.py b/tljh/apt.py index b5b0845b3..d746f4569 100644 --- a/tljh/apt.py +++ b/tljh/apt.py @@ -1,6 +1,7 @@ """ Utilities for working with the apt package manager """ + import os import subprocess diff --git a/tljh/conda.py b/tljh/conda.py index a543645d9..49737c40f 100644 --- a/tljh/conda.py +++ b/tljh/conda.py @@ -1,6 +1,7 @@ """ Wrap conda commandline program """ + import contextlib import hashlib import json diff --git a/tljh/hooks.py b/tljh/hooks.py index ddaa2a314..8bdaf790a 100644 --- a/tljh/hooks.py +++ b/tljh/hooks.py @@ -1,6 +1,7 @@ """ Hook specifications that pluggy plugins can override """ + import pluggy hookspec = pluggy.HookspecMarker("tljh") diff --git a/tljh/log.py b/tljh/log.py index ed7eca41a..7a0d5e716 100644 --- a/tljh/log.py +++ b/tljh/log.py @@ -1,4 +1,5 @@ """Setup tljh logging""" + import logging import os diff --git a/tljh/normalize.py b/tljh/normalize.py index 01d1777a9..4f4c9e10c 100644 --- a/tljh/normalize.py +++ b/tljh/normalize.py @@ -1,6 +1,7 @@ """ Functions to normalize various inputs """ + import hashlib diff --git a/tljh/systemd.py b/tljh/systemd.py index f274fab58..6bfaf1b84 100644 --- a/tljh/systemd.py +++ b/tljh/systemd.py @@ -3,6 +3,7 @@ If we use a debian package instead, we can get rid of all this code. """ + import os import subprocess diff --git a/tljh/traefik.py b/tljh/traefik.py index 4ea0d49a1..a19a3deb2 100644 --- a/tljh/traefik.py +++ b/tljh/traefik.py @@ -1,4 +1,5 @@ """Traefik installation and setup""" + import hashlib import io import logging diff --git a/tljh/user.py b/tljh/user.py index f5ed4ca80..b03903f1b 100644 --- a/tljh/user.py +++ b/tljh/user.py @@ -3,6 +3,7 @@ Supports minimal user & group management """ + import grp import pwd import subprocess diff --git a/tljh/utils.py b/tljh/utils.py index 8ab1ca8c8..fceec7052 100644 --- a/tljh/utils.py +++ b/tljh/utils.py @@ -1,6 +1,7 @@ """ Miscellaneous functions useful in at least two places unrelated to each other """ + import logging import re import subprocess diff --git a/tljh/yaml.py b/tljh/yaml.py index e51381e00..daff06bda 100644 --- a/tljh/yaml.py +++ b/tljh/yaml.py @@ -3,6 +3,7 @@ ensures the same yaml settings for reading/writing throughout tljh """ + from ruamel.yaml import YAML from ruamel.yaml.composer import Composer