-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] INFO log level is no longer default for some commands #3038
Comments
We noticed some aberrations in log level/threshold handling as of Setuptools 60.0.0, and the only substantive change for that release toggles the default selection for its internal ("local") distutils replacement vs the "stdlib" one. For now, toggle the SETUPTOOLS_USE_DISTUTILS envvar in our testing back to the old value. This should be revisited once logging is handled better in Setuptools. pypa/setuptools#3038 Change-Id: If372a33607fff884cd7bf888ee5a23a2fbb351b2
* Update pbr from branch 'master' to c718425299af4f4df7b32adb90e8d183e101c6bc - Don't test with setuptools local distutils We noticed some aberrations in log level/threshold handling as of Setuptools 60.0.0, and the only substantive change for that release toggles the default selection for its internal ("local") distutils replacement vs the "stdlib" one. For now, toggle the SETUPTOOLS_USE_DISTUTILS envvar in our testing back to the old value. This should be revisited once logging is handled better in Setuptools. pypa/setuptools#3038 Change-Id: If372a33607fff884cd7bf888ee5a23a2fbb351b2
Hi @cboylan, thank you very much for reporting this problem. I believe I found the cause in #3042. Could you provide a reproduction for this step:
so I can manually test if the fix I devised also applies to your use case? (e.g. dummy package repository on GitHub). |
In my case I just did a local modification to a small utility, bindep, that I happened to have on disk. I've pushed that modification up to https://review.opendev.org/c/opendev/bindep/+/825973. It has been so long since I wrote a proper setup.py that it would probably take me far too long to figure out so hopefully this works. To grab this code yourself you can
If this doesn't work I can probably figure out a smaller case but it might be a few days. |
Thank you very much @cboylan, I think the proposed patch #3042 does fix this problem. cd /tmp
git clone https://opendev.org/opendev/bindep
cd bindep
git fetch https://review.opendev.org/opendev/bindep refs/changes/73/825973/2
git checkout FETCH_HEAD
echo "print('hello world')" > foo/bar.py
virtualenv .venv
.venv/bin/pip install 'setuptools @ git+https://github.com/abravalheri/setuptools@issue-3038'
.venv/bin/python setup.py build_scripts --dry-run and this is the output: /tmp/bindep/.venv/lib/python3.8/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead
warnings.warn(
/tmp/bindep/.venv/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
/tmp/bindep/.venv/lib/python3.8/site-packages/setuptools/command/easy_install.py:157: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/tmp/bindep/.venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/tmp/bindep/.venv/lib/python3.8/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead
warnings.warn(
running build_scripts
changing mode of build/scripts-3.8/bar.py |
We noticed some aberrations in log level/threshold handling as of Setuptools 60.0.0, and the only substantive change for that release[1] toggles the default selection for its internal ("local") distutils replacement vs the "stdlib" one. For now, toggle the SETUPTOOLS_USE_DISTUTILS envvar in our testing back to the old value. This should be revisited once logging is handled better in Setuptools. [1] pypa/setuptools#3038 Change-Id: I2eacb9756d9eb9c5d606599f16cdb412007f5854
* Update oslo.context from branch 'master' to 8d44224e52e6b0c607c3df0b20d758ca3ccb4ff8 - Don't test with setuptools local distutils. We noticed some aberrations in log level/threshold handling as of Setuptools 60.0.0, and the only substantive change for that release[1] toggles the default selection for its internal ("local") distutils replacement vs the "stdlib" one. For now, toggle the SETUPTOOLS_USE_DISTUTILS envvar in our testing back to the old value. This should be revisited once logging is handled better in Setuptools. [1] pypa/setuptools#3038 Change-Id: I2eacb9756d9eb9c5d606599f16cdb412007f5854
setuptools version
60.0.0 and newer
Python version
Python 3.8
OS
OpenSUSE Tumbleweed
Additional environment information
No response
Description
When running certain commands setuptools seems to log at a
WARN
level and notINFO
level which was the previous default. This appears to have changed with the switch fromstdlib
tolocal
distutils vendoring in 60.0.0. 59.8.0 continues to log at anINFO
level as expected. The latest 60.5.4 release continues to log at a WARN level by default. Commands likesdist
appear to log at anINFO
level though making me suspect that this is limited to distutils commands and not those that setuptools has overridden.The example I've used below is
build_scripts
because it is relatively simple but it seems to affect others as well. Calling this out as recent changing to setuptools logging seem to indicate a desire to maintain backward compat with distutils for now and that seems to have broken though I don't understand how/why. Also, pointing this out in case it points to bigger issues in the local vendoring of distutils.Expected behavior
I expect setuptools to continue logging at INFO level by default.
How to Reproduce
setup.py build_scripts --dry-run
setup.py build_scripts --dry-run
Note that setting -v on the commands does not change the output. Additionally setting SETUPTOOLS_USE_DISTUTILS=stdlib corrects this on newer setuptools indicating the local vendoring is likely to blame.
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: