Bug 2044453 - netgen-mesher python scripting is not packaged in an operable fashion
Summary: netgen-mesher python scripting is not packaged in an operable fashion
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: netgen-mesher
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sandro Mani
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-24 16:25 UTC by Steve Holland
Modified: 2022-02-07 01:16 UTC (History)
2 users (show)

Fixed In Version: netgen-mesher-6.2.2105-3.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-07 01:16:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Correction of the fixed import of pyngcore within libngpy to use the installed package name (485 bytes, patch)
2022-01-24 16:25 UTC, Steve Holland
no flags Details | Diff

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.


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