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

g.extension: fix registration addon with module name start with 2 chars db.*, ps.*, r3.*, wx.* #3168

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Sep 20, 2023

Describe the bug
Not all addon module are registered during installation on the OS MS Windows platform.

To Reproduce
Steps to reproduce the behavior:

  1. Apply PR g.extension: fix installing addons on the OS MS Windows #3166 first please
  2. Try install one of the addons which name start with two characters *db.*, ps.*, r3.*, wx.* e.g. g.extension db.join
  3. Check if installed addon module is registered g.extension -a

Expected behavior
Addon module whose name start with two characters *db.*, ps.*, r3.*, wx.* should be registered during installation same as others addon module.

C:\Users\User>g.extension db.join
Downloading precompiled GRASS Addons <db.join>...
Fetching <db.join> from
<http://wingrass.fsv.cvut.cz/grass84/addons/grass-8.4.0dev/db.join.zip> (be
patient)...
Updating extension modules metadata file...
Installation of <db.join> successfully finished

C:\Users\User>g.extension -a
List of installed extensions (modules):
db.join

System description:

  • Operating System: MS Windows
  • GRASS GIS version: all
C:\Users\User>python3 -c "import sys, wx; print(sys.version); print(wx.version())
3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
4.2.0 msw (phoenix) wxWidgets 3.2.1

Additional context
Problematic is regular expression which not catch addon module name which start with two character *db.*, ps.*, r3.*, wx.*.

# Filter GRASS module name patterns
if re.search(r"^[d,db,g,i,m,p,ps,r,r3,s,t,v,wx]\..*[\.py,\.exe]$", file):

Expected behavior:

In [1]: import re

In [2]: re.search(r"^([d,g,i,m,p,r,s,t,v]|^db|^ps|^r3|^wx)\..*[\.py,\.exe]$", "db.join.py")
Out[2]: <re.Match object; span=(0, 10), match='db.join.py'>

Addon module name start with db.*, ps.*, r3.*, wx.*, during installation
on the OS MS Windows platform.
@tmszi tmszi added bug Something isn't working windows Microsoft Windows specific Python Related code is in Python backport to 8.3 labels Sep 20, 2023
@tmszi tmszi added this to the 8.3.1 milestone Sep 20, 2023
@tmszi tmszi merged commit 6c69587 into OSGeo:main Sep 21, 2023
tmszi added a commit to tmszi/grass that referenced this pull request Sep 21, 2023
…rs (OSGeo#3168)

Addon module name start with db.*, ps.*, r3.*, wx.*, during installation
on the OS MS Windows platform.
tmszi added a commit to tmszi/grass that referenced this pull request Sep 21, 2023
…rs (OSGeo#3168)

Addon module name start with db.*, ps.*, r3.*, wx.*, during installation
on the OS MS Windows platform.
@tmszi tmszi deleted the g_extension-fix-register-addon-during-installation-on-win32-platform branch September 21, 2023 06:14
landam pushed a commit to landam/grass that referenced this pull request Oct 25, 2023
…rs (OSGeo#3168)

Addon module name start with db.*, ps.*, r3.*, wx.*, during installation
on the OS MS Windows platform.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
…rs (OSGeo#3168)

Addon module name start with db.*, ps.*, r3.*, wx.*, during installation
on the OS MS Windows platform.
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Jan 9, 2024
…rs (OSGeo#3168)

Addon module name start with db.*, ps.*, r3.*, wx.*, during installation
on the OS MS Windows platform.
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 windows Microsoft Windows specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants