Created attachment 868311 [details] build log It fails with the following exception: gpep517 build-wheel --backend mesonpy --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/numpy-1.25.2/work/numpy-1.25.2-python3_10/wheel --config-json {"builddir": "/var/tmp/portage/dev-python/numpy-1.25.2/work/numpy-1.25.2-python3_10", "setup-args": ["-Dblas=cblas", "-Dlapack=lapack"], "compile-args": ["-v", "-j16", "-l0"]} 2023-08-21 13:59:30,731 gpep517 INFO Building wheel via backend mesonpy Traceback (most recent call last): File "/usr/lib/python-exec/python3.10/gpep517", line 4, in <module> sys.exit(main()) File "/usr/lib/python3.10/site-packages/gpep517/__main__.py", line 406, in main return func(args) File "/usr/lib/python3.10/site-packages/gpep517/__main__.py", line 202, in build_wheel print(build_wheel_impl(args, args.wheel_dir), file=out) File "/usr/lib/python3.10/site-packages/gpep517/__main__.py", line 194, in build_wheel_impl wheel_name = backend.build_wheel(str(wheel_dir), args.config_json) File "/usr/lib/python3.10/site-packages/mesonpy/__init__.py", line 1047, in wrapper return func(*args, **kwargs) File "/usr/lib/python3.10/site-packages/mesonpy/__init__.py", line 1108, in build_wheel _setup_cli() File "/usr/lib/python3.10/site-packages/mesonpy/__init__.py", line 203, in _setup_cli colorama.init() # fix colors on windows AttributeError: module 'colorama' has no attribute 'init'
Created attachment 868312 [details] emerge --info
It looks like meson-python is what needs it, but these two disagree: 1. https://github.com/mesonbuild/meson-python/blob/ac8c940acb19f122d3f7461521d381d5a77ffa60/mesonpy/__init__.py#L192 2. https://github.com/mesonbuild/meson-python/blob/ac8c940acb19f122d3f7461521d381d5a77ffa60/pyproject.toml#L31 (windows vs not).
I don't think there's a true disagreement here. meson-python uses it if it's available, and insists via pyproject.toml that it should be available on Windows. An argument could be made that it should be an optional "extra" but I don't see what advantage that would bring. The issue here is that you do have colorama installed, it just doesn't have the function that meson-python tries to use. Adding a dependency would do nothing since the problem is that it's there but broken.
(In reply to Eli Schwartz from comment #3) > The issue here is that you do have colorama installed, it just doesn't have > the function that meson-python tries to use. Adding a dependency would do > nothing since the problem is that it's there but broken. I think the point is that numpy has PYTHON_TARGETS python3_10 and python3_11 on my machine whereas colorama has only python3_11 and not python3_10. A dependency with use_dep could fix this.
That doesn't explain why it could import it though. the else clause only gets run if no exception occurred
(In reply to Sam James from comment #5) > That doesn't explain why it could import it though. the else clause only > gets run if no exception occurred Fair question. I did some digging and indeed in Python 3.10 I can `import colorama` but it's an empty module. Looking further I found the folder /usr/lib/python3.10/site-packages/colorama which is empty except for a __pycache__ directory, that contains the following files: __init__.cpython-311.pyc ansi.cpython-311.pyc ansitowin32.cpython-311.pyc initialise.cpython-311.pyc win32.cpython-311.pyc winterm.cpython-311.pyc __init__.cpython-39.pyc ansi.cpython-39.pyc ansitowin32.cpython-39.pyc initialise.cpython-39.pyc win32.cpython-39.pyc winterm.cpython-39.pyc So to me it looks like at some point there was some version confusion on my system and this is a problem on my side. However I'm not aware of having done something strange to colorama so I'm quizzed as to what the culprit is here. I tried `equery belongs` on these files, but no luck.
If there are no enlightening ideas I'm going to close this in a few days as a fluke on my system.
It seems that this was some local fluke. The problem vanished after I removed the mostly empty colorama directory. Closing.