Bug 2044453

Summary: netgen-mesher python scripting is not packaged in an operable fashion
Product: [Fedora] Fedora Reporter: Steve Holland <sh1>
Component: netgen-mesherAssignee: Sandro Mani <manisandro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hobbes1069, manisandro
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: netgen-mesher-6.2.2105-3.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-07 01:16:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Correction of the fixed import of pyngcore within libngpy to use the installed package name none

Description Steve Holland 2022-01-24 16:25:57 UTC
Created attachment 1853105 [details]
Correction of the fixed import of pyngcore within libngpy to use the installed package name

Even after solving Bug #1993574 the Python scripting support for netgen-mesher remains inoperable. 

Specifically: 
   * The Python files are installed with the Python package name "netgen-mesher", which is impossible to import in the normal way, as Python treats the hyphen as a minus sign, creating a syntax error. It is however possible to do the import with importlib.import_module()
   * The files except for the compiled pyngcore module are stored one level too deep. They end up in /usr/lib64/python3.9/site-packages/netgen-mesher/netgen-mesher/ whereas they should be in /usr/lib64/python3.9/site-packages/netgen-mesher/netgen-mesher/
   * Even if the Python files are moved up one level, an internal import of "pyngcore" prevents the packages from loading (fixed in the attached patch)

So: 
   * To get Python scripting to work apply the attached pyngcore_import.patch in addition to the fix for Bug #1993574. Then rebuild, reinstall, and move or copy the contents of /usr/lib64/python3.9/site-packages/netgen-mesher/netgen-mesher/ into /usr/lib64/python3.9/site-packages/netgen-mesher/. 
   * At this point it should be possible to access the module via import importlib;ng=importlib.import_module("netgen-mesher"). 
   * The attached pyngcore_import.patch will have to be modified accordingly if the python package name is changed.

Comment 1 Sandro Mani 2022-01-24 20:10:15 UTC
Thanks for the report, can you try this build? https://koji.fedoraproject.org/koji/taskinfo?taskID=81775359

Comment 2 Fedora Update System 2022-01-28 17:55:45 UTC
FEDORA-2022-fb4b717747 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-fb4b717747

Comment 3 Steve Holland 2022-01-29 05:27:54 UTC
Apologies for the delay; this looks and works a lot better. Thanks!

Comment 4 Sandro Mani 2022-01-29 08:04:53 UTC
Excellent, thanks for the feedback

Comment 5 Fedora Update System 2022-01-30 01:14:25 UTC
FEDORA-2022-fb4b717747 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-fb4b717747`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-fb4b717747

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-02-07 01:16:09 UTC
FEDORA-2022-fb4b717747 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.