Bug 30340 - xasy requires a missed python package
Summary: xasy requires a missed python package
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Rémi Verschelde
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-25 15:45 CEST by Giuseppe Ghibò
Modified: 2022-04-28 11:06 CEST (History)
1 user (show)

See Also:
Source RPM: asymptote-2.68-1.mga8.src.rpm
CVE:
Status comment:


Attachments

Description Giuseppe Ghibò 2022-04-25 15:45:01 CEST
Description of problem:

The package asymptote-gui contains an executable called 'xasy' which is a frontend for 'asymptote'. Running xasy would cause a python traceback:

Traceback (most recent call last):
  File "/usr/bin/xasy", line 6, in <module>
    from Window1 import MainWindow1
  File "/usr/share/asymptote/GUI/Window1.py", line 23, in <module>
    import xasy2asy as x2a
  File "/usr/share/asymptote/GUI/xasy2asy.py", line 36, in <module>
    import xasyOptions as xo
  File "/usr/share/asymptote/GUI/xasyOptions.py", line 154, in <module>
    class BasicConfigs:
  File "/usr/share/asymptote/GUI/xasyOptions.py", line 156, in BasicConfigs
    defaultOpt = xasyOptions(
  File "/usr/share/asymptote/GUI/xasyOptions.py", line 80, in __init__
    self.options = self.defaultOptions()
  File "/usr/share/asymptote/GUI/xasyOptions.py", line 38, in defaultOptions
    opt = cson.loads(f.read())
AttributeError: 'NoneType' object has no attribute 'loads'

The problem is missed four python explicit requirements in package spec file for asymptote-gui. Three of them are:

Requires: python3-numpy
Requires: python3-qt5-svg
Requires: python3-qt5-widgets

The fourth is python3-cson, that we don't have packaged yet. So we need also to package it before.

How to reproduce:

just install asymptote-gui and type 'xasy' from terminal.

Note that the same problem occurs in cauldron's asymptote.
Comment 1 Lewis Smith 2022-04-26 21:04:07 CEST
Thank you for this helpful report.

xasy is in the 'asymptote-gui' package.
This only seems to require currently (of this type):
 $ urpmq --requires asymptote-gui | grep python3
 python3-pillow-tk
 python3-tkinter
For python3-numpy, python3-qt5-svg, python3-qt5-widgets, confirmed that none of these are currently required by asymptote.
Confirmed that pkg 'python3-cson' does not exist.

This is formally akien's SRPM, so assigning this to you.
CC'ing DavidG who did Cauldron 2.69 & 2.70 versios.

Assignee: bugsquad => rverschelde
CC: (none) => geiger.david68210

Comment 2 Giuseppe Ghibò 2022-04-26 21:43:25 CEST
Indeed there are the python3-qt5-svg, python3-qt5-widgets,  python3-numpy dependency. It's not exposed in urpmq, but internally there is. In fact removing such packages and then launcing xasy you get errors:

$ urpme python3-qt5-svg
$ xasy

Traceback (most recent call last):
  File "/usr/bin/xasy", line 6, in <module>
    from Window1 import MainWindow1
  File "/usr/share/asymptote/GUI/Window1.py", line 23, in <module>
    import xasy2asy as x2a
  File "/usr/share/asymptote/GUI/xasy2asy.py", line 15, in <module>
    import PyQt5.QtSvg as Qs
ModuleNotFoundError: No module named 'PyQt5.QtSvg'

$ urpme python3-qt5-widgets
$ xasy

Traceback (most recent call last):
  File "/usr/bin/xasy", line 4, in <module>
    import PyQt5.QtWidgets as Qw
ModuleNotFoundError: No module named 'PyQt5.QtWidgets'

$ urpme python3-numpy
$ xasy
Traceback (most recent call last):
  File "/usr/bin/xasy", line 6, in <module>
    from Window1 import MainWindow1
  File "/usr/share/asymptote/GUI/Window1.py", line 10, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
Comment 3 Giuseppe Ghibò 2022-04-28 11:06:03 CEST
As help, the bug was just fixed in cauldron. The fix is here:

https://svnweb.mageia.org/packages/cauldron/asymptote/current/SPECS/asymptote.spec?r1=1839985&r2=1854685

and the two new missing packages are here:

https://svnweb.mageia.org/packages/cauldron/python-cson/

and here:

https://svnweb.mageia.org/packages/cauldron/python-speg/

(python-speg is required to python-cson).

With all that stuff, now the "xasy" executable runs without errors.

Note You need to log in before you can comment on or make changes to this bug.