diff --git a/colcon_python_setup_py/package_augmentation/python_setup_py.py b/colcon_python_setup_py/package_augmentation/python_setup_py.py index b401440..99cb7b6 100644 --- a/colcon_python_setup_py/package_augmentation/python_setup_py.py +++ b/colcon_python_setup_py/package_augmentation/python_setup_py.py @@ -55,7 +55,6 @@ def augment_package( # noqa: D102 desc.dependencies) def getter(env): - nonlocal setup_py return get_setup_information(setup_py, env=env) desc.metadata['get_python_setup_options'] = getter diff --git a/colcon_python_setup_py/package_identification/python_setup_py.py b/colcon_python_setup_py/package_identification/python_setup_py.py index 466e68d..07c6898 100644 --- a/colcon_python_setup_py/package_identification/python_setup_py.py +++ b/colcon_python_setup_py/package_identification/python_setup_py.py @@ -6,9 +6,9 @@ with suppress(ImportError): # needed before importing distutils # to avoid warning introduced in setuptools 49.2.0 - import setuptools -import distutils.core -import os + import setuptools # noqa: I100 +import distutils.core # noqa: I100, I201, I202 +import os # noqa: I100, I201, I202 from pathlib import Path import runpy import subprocess @@ -238,7 +238,6 @@ def get_setup_information(setup_py, *, env=None): :return: dictionary of data describing the package. :raise: RuntimeError if the setup script encountered an error """ - global _setup_information_cache if env is None: env = os.environ if 'DISTUTILS_DEBUG' in env: