From 5f850a21dba790c197b85e719d49137e4cce17ea Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Fri, 20 Jan 2023 18:00:48 +0000 Subject: [PATCH] Delay import --- setuptools/config/pyprojecttoml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index c305bad079..536247be48 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -11,7 +11,6 @@ from typing import TYPE_CHECKING, Callable, Dict, Optional, Mapping, Set, Union from setuptools.errors import FileError, OptionError -from setuptools.extern.more_itertools import always_iterable from . import expand as _expand from ._apply_pyprojecttoml import apply as _apply @@ -310,6 +309,8 @@ def _ensure_previously_set(self, dist: "Distribution", field: str): def _expand_directive( self, specifier: str, directive, package_dir: Mapping[str, str] ): + from setuptools.extern.more_itertools import always_iterable # type: ignore + with _ignore_errors(self.ignore_option_errors): root_dir = self.root_dir if "file" in directive: