[GRASS-dev] [GRASS GIS] #2895: Define dependencies for GRASS addons

GRASS GIS trac at osgeo.org
Thu Dec 31 08:11:13 PST 2020


#2895: Define dependencies for GRASS addons
--------------------------+-------------------------
  Reporter:  pmav99       |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.8.3
 Component:  Default      |    Version:  unspecified
Resolution:               |   Keywords:  g.extension
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by hcho):

 Replying to [comment:23 sbl]:
 > I just added a draft for a python script that could take care of
 dependencies in Python (conda not tested) and R packages. Other
 dependencies (e.g. C-libraries, commandline tools) are just checked,
 neither loading of the libraries not installation is supported at the
 moment (not sure if the latter is realistic).
 > The function has three modes: check (warns of missing dependencies),
 install (installs missing dependencies (if possible), abort (stops if
 dependencies are missing).
 > It takes the following arguments as input:
 >
 >  - dependency_type
 >  - dependency
 >  - version=None
 >  - version_comparison=None
 >  - repository=None
 >  - optional=False
 >
 > and could be fed e.g. from a table describing dependencies. dependency
 versions, and specific repositories are not supported yet. Let me know
 what you think, and i see how it could be integrated in g.extension.

 handle_dependencies.py looks good. Just have a few comments.

 {{{
 cmd R 3.4 >=
 cmd cmdfail 3.4 >=
 R_package igraph 0.7.1 >=
 R_package R_fail_test 0.7.1 >=
 }}}
 looks unnatural and error-prone. Would it be possible to change this
 format to
 {{{
 cmd R >= 3.4
 cmd cmdfail >= 3.4
 R_package igraph >= 0.7.1
 R_package R_fail_test >= 0.7.1
 }}}

 Also, how about defining dependency information inside modules themselves
 instead of using an external file? We already have `G_option_*()`
 functions to handle option dependency. Maybe, `G_module_requires(void
 *first, ...), G_module_requires_python(void *first, ...),
 G_module_requires_r(void *first, ...)` and
 {{{
 G_module_requires("r.stream.distance", NULL);
 G_module_requires_python("numpy", "gdal", NULL);
 }}}
 Then, add a new global flag `--dependencies` to spit out dependency
 information?

 Just my 2 cents.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2895#comment:24>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list