-
-
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] AttributeError: module 'distutils.log' has no attribute 'warning' #3707
Comments
I've been experiencing the same issue on python 3.7.9, I think I've narrowed it down to the patching happening in I might suggest a very naive potential solution for the maintainers of this repo is to simply reverse the patch so the functional logger from My pull request with the above change: |
We're also hitting this in our github actions (py3.8/3.9) and locally (py3.11). reproducer: failing actions against python 3.8 and 3.9: @jaraco it looks like this was an unintended consequence of #3674 |
I believe that the reason why the test suite did not catch this problem is because the conditions are somehow rare: the If the Regardless, I am working on a fix in #3709. |
This is a workaround for pypa/setuptools#3707
* Switch classifiers from a tuple to a list Recommended by @abravalheri in pypa/setuptools#3707 (comment) * Fix github URL for pycqa/flake8 precommit hook Co-authored-by: jyejare <jyejare@redhat.com>
* Switch classifiers from a tuple to a list Recommended by @abravalheri in pypa/setuptools#3707 (comment) * Fix github URL for pycqa/flake8 precommit hook Co-authored-by: jyejare <jyejare@redhat.com> (cherry picked from commit 8012321)
This is a workaround for pypa/setuptools#3707
* Switch classifiers from a tuple to a list Recommended by @abravalheri in pypa/setuptools#3707 (comment) * Fix github URL for pycqa/flake8 precommit hook Co-authored-by: jyejare <jyejare@redhat.com> (cherry picked from commit 8012321) Co-authored-by: Jake Callahan <jacob.callahan05@gmail.com>
Hi, now that setuptools 65.6.3 is released, maybe you can yank (delete) the versions causing the bug (65.6.2 and 65.6.1) from pypi. |
We are currently running poetry to install packages based out of pyproject.toml file, one particular package: google-oauth (version 1.0.0) breaks while running 'poetry install' with below output: setuptools version: 59.6.0 CalledProcessError
Command '['/root/.cache/pypoetry/virtualenvs/whelk-xLPSQsjl-py3.10/bin/python', '/root/.local/share/pypoetry/venv/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-21.0.1-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/root/.cache/pypoetry/virtualenvs/whelk-xLPSQsjl-py3.10', '--no-deps', '/root/.cache/pypoetry/artifacts/03/af/eb/2a591ad20f9688/google-oauth-1.0.0.tar.gz']' returned non-zero exit status 1.
at /usr/lib/python3.10/subprocess.py:524 in run
520│ # We don't call process.wait() as .__exit__ does that for us.
521│ raise
522│ retcode = process.poll()
523│ if check and retcode:
→ 524│ raise CalledProcessError(retcode, process.args,
525│ output=stdout, stderr=stderr)
526│ return CompletedProcess(process.args, retcode, stdout, stderr)
527│
528│
The following error occurred when trying to handle this error:
EnvCommandError
Command ['/root/.cache/pypoetry/virtualenvs/whelk-xLPSQsjl-py3.10/bin/python', '/root/.local/share/pypoetry/venv/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-21.0.1-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/root/.cache/pypoetry/virtualenvs/whelk-xLPSQsjl-py3.10', '--no-deps', '/root/.cache/pypoetry/artifacts/03/af/eb/53c45f6e116b0b6a60a1e5421908aaa2aa0e614e0be92a591ad20f9688/google-oauth-1.0.0.tar.gz'] errored with the following return code 1, and output:
Looking in indexes: https://python.repo.eng.netapp.com/simple
Processing /root/.cache/pypoetry/artifacts/03/af/eb/53c45f6e116b0b6a60a1e5421908aaa2aa0e614e0be92a591ad20f9688/google-oauth-1.0.0.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /root/.cache/pypoetry/virtualenvs/whelk-xLPSQsjl-py3.10/bin/python /tmp/tmp5wyd5g9v_in_process.py get_requires_for_build_wheel /tmp/tmpvgs7tvrm
cwd: /tmp/pip-req-build-upw4n6bh
Complete output (29 lines):
Traceback (most recent call last):
File "/tmp/tmp5wyd5g9v_in_process.py", line 280, in <module>
main()
File "/tmp/tmp5wyd5g9v_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/tmp/tmp5wyd5g9v_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 11, in <module>
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 475, in __init__
_Distribution.__init__(
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 258, in __init__
getattr(self.metadata, "set_" + key)(val)
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1242, in set_classifiers
self.classifiers = _ensure_list(value, 'classifiers')
File "/tmp/pip-build-env-r6vw3w7x/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 48, in _ensure_list
log.warning(msg)
AttributeError: module 'distutils.log' has no attribute 'warning'. Did you mean: 'warnings'? Can you please suggest if setuptools latest version will solve the Attribute error ? |
@abhinov-netapp I believe so: $ virtualenv .venv
$ .venv/bin/python -m pip install -U pip wheel 'setuptools==65.6.3'
$ .venv/bin/python -m pip install --no-build-isolation 'google-oauth==1.0.0'
# ...
Successfully built google-oauth
Installing collected packages: urllib3, six, pycparser, idna, charset-normalizer, certifi, requests, cffi, cryptography, pyopenssl, google-oauth
Successfully installed certifi-2022.9.24 cffi-1.15.1 charset-normalizer-2.1.1 cryptography-38.0.3 google-oauth-1.0.0 idna-3.4 pycparser-2.21 pyopenssl-22.1.0 requests-2.28.1 six-1.16.0 urllib3-1.26.13 |
setuptools version
setuptools==65.6.2
Python version
Python 3.8.15
OS
macOS 12.5.1
Additional environment information
No response
Description
Installing a package
kappa=0.6.0
doesn't work. I think it could be the issue on setuptools's side.Expected behavior
Installing the package works.
How to Reproduce
Output
The text was updated successfully, but these errors were encountered: