pypa / distutils

distutils as found in cpython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parse_command_line() alters root logger logging level.

mbway opened this issue · comments

Distribution.parse_command_line() alters the root logger logging level.

In a change introduced in this commit, Distribution.parse_command_line() sets the logging level of the root logger instead of a distutils specific logger.

This is an unintended and undesirable side effect when using Distribution as a component of a larger system. For example this issue where importing a Cython module with pyximport affects the root logger logging level.

import logging
logging.getLogger().setLevel(logging.INFO)

import pyximport
pyximport.install(language_level=3)

print(logging.getLogger().isEnabledFor(logging.INFO))  # True
import example_cython
print(logging.getLogger().isEnabledFor(logging.INFO))  # False

Distutils would like to eliminate use of distutils as an API (make it available only as a function of a setuptools build backend). Would you check with the pyximport project and ensure there's a bug tracking the deprecation of distutils as an API and explore ways to support pyximport without importing distutils or Setuptools?

there is this issue cython/cython#4405 but there doesn't seem to have been much progress in a while. You say 'without importing distutils or Setuptools'. Does this mean that ideally setuptools should not be used as a library either?