Comments (4)
Hi @vsajip, thank you very much for opening the issue.
/cc @jaraco should we transfer this issue to the pypa/distutils
repository?
from setuptools.
Perhaps, although setuptools.logging does the same thing:
setuptools/setuptools/logging.py
Line 37 in b000f0c
So we should probably handle the issue here first.
More importantly, Setuptools and distutils are getting out of the business of acting as a library, except as a backend for builders.
@vsajip - what's your use-case for using Setuptools as a library? Under what conditions does the current implementation cause problems? This behavior goes back decades, so it'll likely be difficult to disentangle, especially with the dual-implementation nature of setuptools+distutils.
from setuptools.
The problem surfaced when I ran the unit tests for an old project (logutils
) which uses distutils
(it dates from around Python 3.2) - the tests ran fine on Python 3.10, but failed on 3.11 because the legacy code in setup.py
called parse_command_line()
, and this caused the root logger to have a different initial state than it does under 3.10 and older. (This old project uses python setup.py test
to run the tests.)
I would have thought the solution should be to move the logic from parse_command_line()
to wherever output is about to be done. I'm not sure whether in this case logging
is being used to do normal program output, but if so, then that's not good practice, either. Use of the root logger should only be for simple single-file scripts - in all other cases, named loggers (and not the root) should be used to identify where a logging event is coming from, and to allow application writers or sysadmins to configure logging verbosity for that part of the system.
from setuptools.
so this is the culprit, I was scratching my forehead since a month why in my small project the root logger was set to logging.WARN
state at startup each time and after doing painstaking debugging every now and then, I just realised today it started occuring ever since I updated setuptools last month from v65.6.0 to latest. It took me a while to find this issue. You guys should revert this change. The amount of debugging I have done to find the cause is insane and this bug is not pleasant to say the least.
This change was introduced in #3674 in case someone find that useful.
from setuptools.
Related Issues (20)
- Requires-Dist metadata not canonicalized between wheels and sdists HOT 4
- Using `setuptools.extern.importlib_metadata.EntryPoints.names` is incompatible with older versions of `importlib_metadata` and/or `importlib.metadata`
- [BUG] optional dependency identifiers in a dynamic section cannot contain hyphens HOT 2
- [Potential BUG] Unexpected error in test suite: `test_type_files_included_by_default`
- Binary wheel 'zhlyr-4.2-cp312-cp312-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'. HOT 7
- [BUG] can not see compilation (can't see gcc command line options when compiling) HOT 1
- [BUG] test_editable_install fails on Fedora HOT 4
- [BUG] `egg-info`'s `tag_build`/`tag_date` behaviour compatibility with dynamic aspects of PEP 621 HOT 1
- [BUG] No module named 'pkg_resources.extern' HOT 19
- [Docs] 70.0.0 should state breaking change of removal of `packaging.pkg_resources` HOT 4
- [BUG] setuptools not working with 3.13.0b1 HOT 2
- [BUG] v70.0.0 removes 'packaging' from pkg_resources HOT 2
- [BUG] Calling `pip install .` to build/install setuptools multiple times in a row results in unwanted `build/lib/...` files
- Incompatible install in (summarize your environment)
- [BUG] Parsing of __init__.py fails to reach _read_utf8_with_fallback at the end of file HOT 21
- [BUG] python3.12.3 ModuleNotFoundError: No module named 'distutils' HOT 2
- [BUG] Package data not installing nested dirs HOT 9
- test suite uses deprecated mktemp
- [BUG] The new version 70.0.0 creates the following exception when I execute my tool:Traceback (most recent call last): File "PyInstaller/hooks/rthooks/pyi_rth_pkgres.py", line 158, in <module> File "PyInstaller/hooks/rthooks/pyi_rth_pkgres.py", line 36, in _pyi_rthook File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module File "pkg_resources/__init__.py", line 77, in <module> ModuleNotFoundError: No module named 'pkg_resources.extern' [14522] Failed to execute script 'pyi_rth_pkgres' due to unhandled exception! I switch back to 69.5.1 for now. HOT 1
- [BUG] Dynamic version attr with leading dot broken in 70.0.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setuptools.