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

[Bug] i.wi: does not install #4761

Open
veroandreo opened this issue Nov 18, 2024 · 7 comments
Open

[Bug] i.wi: does not install #4761

veroandreo opened this issue Nov 18, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@veroandreo
Copy link
Contributor

Name of the addon
i.wi.

Describe the bug
Running g.extension extension=i.wi gives the following error in GRASS 8.4 (in Colab) and grass main too (locally):

WARNING: Extension <i.wi> already installed. Re-installing...
Fetching <i.wi> from <https://github.com/OSGeo/grass-addons/> (be
patient)...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 25 (delta 0), reused 1 (delta 0), pack-reused 13 (from 1)
Receiving objects: 100% (25/25), 21.36 KiB | 497.00 KiB/s, done.
Already on 'grass8'
Your branch is up to date with 'origin/grass8'.
Compiling...
main.c: In function ‘main’:
main.c:338:27: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  338 |             if ((redchan) && Rast_is_d_null_value(&d_redchan) ||
main.c:55:16: warning: unused variable ‘j’ [-Wunused-variable]
   55 |     int i = 0, j = 0;
      |                ^
main.c:55:9: warning: unused variable ‘i’ [-Wunused-variable]
   55 |     int i = 0, j = 0;
      |         ^
main.c:49:11: warning: unused variable ‘name’ [-Wunused-variable]
   49 |     char *name;             /*input raster name */
      |           ^~~~
main.c:48:19: warning: unused variable ‘colors’ [-Wunused-variable]
   48 |     struct Colors colors;   /*Color rules */
      |                   ^~~~~~
main.c:46:18: warning: unused variable ‘flag1’ [-Wunused-variable]
   46 |     struct Flag *flag1;
      |                  ^~~~~
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
Traceback (most recent call last):
  File "/home/veroandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/scripts/g.extension", line 2881, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/veroandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/scripts/g.extension", line 2861, in main
    install_extension(source=source, url=url, xmlurl=xmlurl, branch=branch)
  File "/home/veroandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/scripts/g.extension", line 1224, in install_extension
    update_manual_page(module)
  File "/home/veroandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/scripts/g.extension", line 2429, in update_manual_page
    for a in get_multi_addon_addons_which_install_only_html_man_page():
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/veroandreo/software/grass-dev/dist.x86_64-pc-linux-gnu/scripts/g.extension", line 1470, in get_multi_addon_addons_which_install_only_html_man_page
    addon_paths.pop(addon_paths.index(addon_src_file.group(0)))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: 'src/gui/wxpy' is not in list

To Reproduce

  1. Run g.extension extension=i.wi

Expected behavior
Well, the addon should be installed properly.

System description:

GRASS version: 8.5.0dev                                                         
Code revision: f62faf221d                                                       
Build date: 2024-11-18                                                          
Build platform: x86_64-pc-linux-gnu                                             
GDAL: 3.5.3                                                                     
PROJ: 9.0.1                                                                     
GEOS: 3.11.0                                                                    
SQLite: 3.40.0                                                                  
Python: 3.11.6                                                                  
wxPython: 4.2.0                                                                 
Platform: Linux-6.5.12-100.fc37.x86_64-x86_64-with-glibc2.36                    

Additional context
I report here as an i.wi issue because other addons install just fine, i.e., i.eodag, i.sentinel, etc.

@ecodiv
Copy link
Contributor

ecodiv commented Nov 22, 2024

I can confirm this for 8.4 on Ubuntu 24.04 (Linux 6.8.0-48)

@petrasovaa
Copy link
Contributor

I believe this should be reported as g.extension bug, I think perhaps bug in some regular expressions in get_multi_addon_addons_which_install_only_html_man_page.

@veroandreo
Copy link
Contributor Author

Shall I transfer the issue then? Dunno if I have permission for that.

@echoix

This comment has been minimized.

@neteler neteler transferred this issue from OSGeo/grass-addons Nov 25, 2024
@neteler neteler added the bug Something isn't working label Nov 25, 2024
@tmszi
Copy link
Member

tmszi commented Nov 28, 2024

It seems that the installation process of i.wi addon it works as expected now (tested with 8.5.0dev version, revision 231bb51, Gentoo GNU/Linux distribution):

GRASS fire_grass6data/demomapset:~ > g.extension extension=i.wi
WARNING: Extension <i.wi> already installed. Re-installing...
Fetching <i.wi> from <https://github.com/OSGeo/grass-addons/> (be
patient)...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 25 (delta 0), reused 1 (delta 0), pack-reused 13 (from 1)
Receiving objects: 100% (25/25), 21.36 KiB | 546.00 KiB/s, done.
Already on 'grass8'
Your branch is up to date with 'origin/grass8'.
Compiling...
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
Installation of <i.wi> successfully finished

Installed i.wi addon module

GRASS fire_grass6data/demomapset:~ > i.wi --help
Calculates different types of water indices.

Usage:
 i.wi winame=type [blue=name] [green=name] [red=name] [nir=name]
   [band5=name] [band7=name] output=name [--overwrite] [--help]
   [--verbose] [--quiet] [--ui]

Parameters:
  winame   Type of water index
           options: awei_ns,awei_s,lswi,ndwi_mf,ndwi_x,tcw,wi
           default: lswi
    blue   Name of input blue channel surface reflectance map
   green   Name of input green channel surface reflectance map
     red   Name of input red channel surface reflectance map
     nir   Name of input nir channel surface reflectance map
   band5   Name of input 5th channel surface reflectance map
   band7   Name of input 7th channel surface reflectance map
  output   Name of the output wi layer

@ecodiv
Copy link
Contributor

ecodiv commented Nov 29, 2024

It indeed installs on 8.5.0dev (5c1ea4a) on Ubuntu 24.04. There is still a warning, but it gets installed.

WARNING: Extension <i.wi> already installed. Re-installing...
Fetching <i.wi> from <https://github.com/OSGeo/grass-addons/> (be patient)...
Your branch is up to date with 'origin/grass8'.
Already on 'grass8'
Compiling...
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
Traceback (most recent call last):
  File "/usr/local/grassmaster/grass85/scripts/g.extension",
line 2870, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/grassmaster/grass85/scripts/g.extension",
line 2850, in main
    install_extension(source=source, url=url, xmlurl=xmlurl,
branch=branch)
  File "/usr/local/grassmaster/grass85/scripts/g.extension",
line 1223, in install_extension
    update_manual_page(module)
  File "/usr/local/grassmaster/grass85/scripts/g.extension",
line 2422, in update_manual_page
    for a in
get_multi_addon_addons_which_install_only_html_man_page():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/grassmaster/grass85/scripts/g.extension",
line 1469, in
get_multi_addon_addons_which_install_only_html_man_page
addon_paths.pop(addon_paths.index(addon_src_file.group(0)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: 'src/gui/wxpy' is not in list

@veroandreo
Copy link
Contributor Author

Indeed it installs, though it is not clear that it installs because it yields the error and not the "successfully installed extension" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants