From ddbf442a30d64fd1ed47ef31e353a376cce906ab Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:27:46 -0400 Subject: [PATCH] Update to isort and black 24 --- tests/test_installer.py | 1 + tests/test_metadata.py | 1 + tests/test_transients.py | 3 ++- tox_poetry_installer/_poetry.py | 1 + tox_poetry_installer/constants.py | 1 + tox_poetry_installer/hooks/_tox_on_install_helpers.py | 2 ++ tox_poetry_installer/hooks/tox_add_env_config.py | 1 + tox_poetry_installer/hooks/tox_add_option.py | 1 + tox_poetry_installer/hooks/tox_on_install.py | 1 + tox_poetry_installer/logger.py | 1 + 10 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_installer.py b/tests/test_installer.py index 4f9c6ee..e8158cd 100644 --- a/tests/test_installer.py +++ b/tests/test_installer.py @@ -7,6 +7,7 @@ import tox.tox_env.python.virtual_env.runner from poetry.factory import Factory import tox_poetry_installer.hooks._tox_on_install_helpers + from .fixtures import mock_poetry_factory from .fixtures import mock_venv diff --git a/tests/test_metadata.py b/tests/test_metadata.py index c28e9da..435a4e2 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -3,6 +3,7 @@ The next best thing to having one source of truth is having a way to ensure all of your sources of truth agree with each other. """ + from pathlib import Path import toml diff --git a/tests/test_transients.py b/tests/test_transients.py index 8766278..dbfa217 100644 --- a/tests/test_transients.py +++ b/tests/test_transients.py @@ -4,9 +4,10 @@ import poetry.utils.env import pytest import tox_poetry_installer.hooks._tox_on_install_helpers +from tox_poetry_installer import exceptions + from .fixtures import mock_poetry_factory from .fixtures import mock_venv -from tox_poetry_installer import exceptions def test_allow_missing(): diff --git a/tox_poetry_installer/_poetry.py b/tox_poetry_installer/_poetry.py index f35e9cd..d433146 100644 --- a/tox_poetry_installer/_poetry.py +++ b/tox_poetry_installer/_poetry.py @@ -21,6 +21,7 @@ at the module scope it is imported into function scope wherever Poetry component moves import errors from load time to runtime which allows the plugin to be skipped if Poetry isn't installed and/or a more helpful error be raised within the Tox framework. """ + import sys from tox_poetry_installer import exceptions diff --git a/tox_poetry_installer/constants.py b/tox_poetry_installer/constants.py index 76afc1b..e5ceae3 100644 --- a/tox_poetry_installer/constants.py +++ b/tox_poetry_installer/constants.py @@ -5,6 +5,7 @@ in this module. All constants should be type hinted. """ + from typing import Tuple from tox_poetry_installer import __about__ diff --git a/tox_poetry_installer/hooks/_tox_on_install_helpers.py b/tox_poetry_installer/hooks/_tox_on_install_helpers.py index 693ad4a..eefe0dc 100644 --- a/tox_poetry_installer/hooks/_tox_on_install_helpers.py +++ b/tox_poetry_installer/hooks/_tox_on_install_helpers.py @@ -1,4 +1,5 @@ """Helper functions for the :func:`tox_on_install` hook""" + import collections import concurrent.futures import contextlib @@ -20,6 +21,7 @@ from tox_poetry_installer import constants from tox_poetry_installer import exceptions from tox_poetry_installer import logger + if typing.TYPE_CHECKING: from tox_poetry_installer import _poetry diff --git a/tox_poetry_installer/hooks/tox_add_env_config.py b/tox_poetry_installer/hooks/tox_add_env_config.py index 019d3ac..fe77723 100644 --- a/tox_poetry_installer/hooks/tox_add_env_config.py +++ b/tox_poetry_installer/hooks/tox_add_env_config.py @@ -1,4 +1,5 @@ """Add required env configuration options to the tox INI file""" + from typing import List from tox.config.sets import EnvConfigSet diff --git a/tox_poetry_installer/hooks/tox_add_option.py b/tox_poetry_installer/hooks/tox_add_option.py index 8d59737..8f07751 100644 --- a/tox_poetry_installer/hooks/tox_add_option.py +++ b/tox_poetry_installer/hooks/tox_add_option.py @@ -1,4 +1,5 @@ """Add additional command line arguments to tox to configure plugin behavior""" + from tox.config.cli.parser import ToxParser from tox.plugin import impl diff --git a/tox_poetry_installer/hooks/tox_on_install.py b/tox_poetry_installer/hooks/tox_on_install.py index be3ffde..d9b9e47 100644 --- a/tox_poetry_installer/hooks/tox_on_install.py +++ b/tox_poetry_installer/hooks/tox_on_install.py @@ -4,6 +4,7 @@ Loads the local Poetry environment and the corresponding lockfile then pulls the specified by the Tox environment. Finally these dependencies are installed into the Tox environment using the Poetry ``PipInstaller`` backend. """ + from itertools import chain from tox.plugin import impl diff --git a/tox_poetry_installer/logger.py b/tox_poetry_installer/logger.py index 1833307..959e427 100644 --- a/tox_poetry_installer/logger.py +++ b/tox_poetry_installer/logger.py @@ -4,6 +4,7 @@ Calling ``tox.reporter.something()`` and having to format a string with the pref gets really old fast, but more importantly it also makes the flow of the main code more difficult to follow because of the added complexity. """ + import logging from tox_poetry_installer import constants