Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wx.metadata: lazy import owslib so pre-compiling for MS Windows succeeds #924

Merged
merged 3 commits into from
Jul 3, 2023

Conversation

ninsbl
Copy link
Member

@ninsbl ninsbl commented Jun 14, 2023

Pre-compilation of wx.metadata for MS Windows fails because owslib is not consequently lazy-imported.

See:
OSGeo/grass#2517

@ninsbl ninsbl added bug Something isn't working Python Related code is in Python labels Jun 14, 2023
@ninsbl ninsbl requested a review from tmszi June 14, 2023 19:31
Copy link
Member

@tmszi tmszi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My implementation of lazy module import (mdutil module) not working as expected. I'm going to refactoring it all.

@tmszi
Copy link
Member

tmszi commented Jul 3, 2023

Successfully tested with:

test@gentoo-gnu-linux:~$ python -c "import owslib"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'owslib'

GRASS epsg_4326/PERMANENT:~ > g.extension wx.metadata url=$HOME/src/grass-addons/src/gui/wxpython/wx.metadata/
Compiling...
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
Installation of <wx.metadata> successfully finished

@ninsbl
Copy link
Member Author

ninsbl commented Jul 3, 2023

Thanks @tmszi !

@ninsbl ninsbl merged commit c69fbf4 into OSGeo:grass8 Jul 3, 2023
6 checks passed
@ninsbl ninsbl deleted the wx_metadata branch July 3, 2023 09:00
cwhite911 pushed a commit to cwhite911/grass-addons that referenced this pull request Sep 19, 2023
…eds (OSGeo#924)

* lazy import owslib

* wxGUI/wx.metadata: fix lazy import py owslib

* Fix black formatting errors

---------

Co-authored-by: Tomas Zigo <tomas.zigo@slovanet.sk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants