Opened 16 months ago

Closed 6 days ago

#67872 closed defect (worksforme)

py-numpy @1.24.1: port install -vst fails with AttributeError: module 'tomli' has no attribute 'TOMLDecodeError'

Reported by: macportsraf Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: py-numpy

Description

While testing port install -vst py-photomosaic the following error occurred:

:info:build Traceback (most recent call last):
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-numpy/py310-numpy/work/numpy-1.24.1/versioneer.py", line 379, in get_config_from_root
:info:build     pp = tomli.load(fobj)
:info:build AttributeError: module 'tomli' has no attribute 'load'
:info:build During handling of the above exception, another exception occurred:
:info:build Traceback (most recent call last):
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-numpy/py310-numpy/work/numpy-1.24.1/setup.py", line 35, in <module>
:info:build     FULLVERSION = versioneer.get_version()
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-numpy/py310-numpy/work/numpy-1.24.1/versioneer.py", line 1791, in get_version
:info:build     return get_versions()["version"]
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-numpy/py310-numpy/work/numpy-1.24.1/versioneer.py", line 1723, in get_versions
:info:build     cfg = get_config_from_root(root)
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-numpy/py310-numpy/work/numpy-1.24.1/versioneer.py", line 381, in get_config_from_root
:info:build     except (tomli.TOMLDecodeError, KeyError):
:info:build AttributeError: module 'tomli' has no attribute 'TOMLDecodeError'

Installing without -vst works.

Attachments (1)

main.log (98.2 KB) - added by macportsraf 16 months ago.

Download all attachments as: .zip

Change History (6)

Changed 16 months ago by macportsraf

Attachment: main.log added

comment:1 Changed 16 months ago by jmroot (Joshua Root)

Owner: set to michaelld
Status: newassigned

The attached log is for py310-re2.

comment:2 Changed 16 months ago by macportsraf

I just noticed that too. So I installed py-numpy, whic workd, then uninstalled it, and tried port install -vst py.numpy again, and there was no problem. I think this should be closed. This originated from trying port install -vst py-photomosaic. Installing that without -vst then trying again with -vst worked as well.

comment:3 in reply to:  2 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to macportsraf:

I think this should be closed.

I am experiencing this problem when trying to upgrade py310-numpy in trace mode, so I would like for it to be fixed before it is closed.

comment:4 Changed 15 months ago by reneeotten (Renee Otten)

There is code in the file versioneer.py that reads:

try:
    import tomli
    have_tomli = True
except ImportError:
    have_tomli = False

so it appears to be fine not to have tomli installed.

So this looks like an more commonly observed issue with trace-mode, where doing import <module> works in trace-mode, but then it fails when that module is actually accessed in the actual code. There have been more reports of this, one of them is #65109; there are others where @jmroot responded to but I cannot find those at the moment.

AFAIK there is nothing to fix here in the py-numpy port; if anything, trace-mode in base has been fixed to resolve these issues.

comment:5 Changed 6 days ago by reneeotten (Renee Otten)

Resolution: worksforme
Status: assignedclosed

py-numpy is now at 1.26.4 and now uses meson to build.

Note: See TracTickets for help on using tickets.