Skip to content

add roxygen2 support for install_github #523

Closed

Description

@phonixor

I let roxygen2 build all my docs and so i decided not to sync my /man directory, as this would just be more useless syncing, downloading and uploading. however now when someone tries to use my package with install_github (instead of CRAN) they don't get the documentation.

is it possible to add a switch, that during the building process install_github calls a roxygenize()

(i think this might be prefered behavior, as this enforces up to date documentation (until roxygen2 rejects your tags of course ))

Activity

  1. wush978 commented on Jul 14, 2014

    @wush978

    For development, maybe you could call the roxygenize through autotools.

    For example, write a configure.ac:

    #                                               -*- Autoconf -*-
    # Process this file with autoconf to produce a configure script.
    
    AC_PREREQ([2.69])
    AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
    Rscript -e "library(roxygen2);roxygenize()"
    AC_OUTPUT
    

    Then, call autoconf once to generate configure. After shipping the package with configure, the client will re-generate document with roxygenize before installing the packge.

  2. phonixor commented on Jul 14, 2014

    @phonixor
    Author

    i am not familiar with autoconf and stuff, but how can this be called in combination with install_github()?

    install_github() downloads the source code, compiles it into a binary package, and then deletes the source code, with no chance to intervene as far as i know.

    its also relatively hard to make your own install_github(), as https is not supported by R by default.... which is kinda silly

  3. wush978 commented on Jul 14, 2014

    @wush978

    I put an example here: https://github.com/wush978/DemoAutotoolWithRoxygenize

    Try:

    library(devtools)
    install_github("DemoAutotoolWithRoxygenize", "wush978")
    library(Test)
    ?hello

    There is no man and NAMESPACE in the source. The configure script will launch roxygenize to generate them before installation.

  4. phonixor commented on Jul 14, 2014

    @phonixor
    Author

    Awesome!

    So R CMD BUILD or R CMD INSTALL checks for a file named configure.ac in the projects root directory? and then calls autoconfig to create the configure file ?

    gonna try at home if that works on windows as well (i figure that would require Rtools)

  5. phonixor commented on Jul 15, 2014

    @phonixor
    Author

    @wch sorry i should have seen that issue.

    @wush978
    on windows i get the following:

    > install_github("DemoAutotoolWithRoxygenize", "wush978")
    Installing github repo DemoAutotoolWithRoxygenize/master from wush978
    Downloading master.zip from https://github.com/wush978/DemoAutotoolWithRoxygenize/archive/master.zip
    Installing package from C:\Users\phonixor\AppData\Local\Temp\RStudioPortableTemp\RtmpIHbLTx/master.zip
    Installing Test
    "D:/PORTAB~1/R-PORT~1/App/R-PORT~1/bin/x64/R" --vanilla CMD INSTALL  \
      "C:\Users\phonixor\AppData\Local\Temp\RStudioPortableTemp\RtmpIHbLTx\devtools10ec3e51335f\DemoAutotoolWithRoxygenize-master"  \
      --library="C:/Users/phonixor/Documents/R/win-library/3.0" --install-tests 
    
    * installing *source* package 'Test' ...
    
       **********************************************
       WARNING: this package has a configure script
             It probably needs manual configuration
       **********************************************
    
    
    ERROR: a 'NAMESPACE' file is required
    * removing 'C:/Users/phonixor/Documents/R/win-library/3.0/Test'
    Error: Command failed (1)
    

    gonna test if it works if i add a NAMESPACE file

  6. phonixor commented on Jul 15, 2014

    @phonixor
    Author

    ok even if i add a NAMESPACE file it still does not work on windows, and so its not a valid solution :(

    > install_github("DemoAutotoolWithRoxygenize", "phonixor")
    Installing github repo DemoAutotoolWithRoxygenize/master from phonixor
    Downloading master.zip from https://github.com/phonixor/DemoAutotoolWithRoxygenize/archive/master.zip
    Installing package from C:\Users\phonixor\AppData\Local\Temp\RStudioPortableTemp\Rtmp8OT0hB/master.zip
    Installing Test
    "D:/PORTAB~1/R-PORT~1/App/R-PORT~1/bin/x64/R" --vanilla CMD INSTALL  \
      "C:\Users\phonixor\AppData\Local\Temp\RStudioPortableTemp\Rtmp8OT0hB\devtools20907afc2d1c\DemoAutotoolWithRoxygenize-master"  \
      --library="C:/Users/phonixor/Documents/R/win-library/3.0" --install-tests 
    
    * installing *source* package 'Test' ...
    
       **********************************************
       WARNING: this package has a configure script
             It probably needs manual configuration
       **********************************************
    
    
    ** R
    ** preparing package for lazy loading
    ** help
    No man pages found in package  'Test' 
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch - i386
    *** arch - x64
    * DONE (Test)
    
  7. hadley commented on Aug 21, 2014

    @hadley
    Member

    Dup of #397.

  8. locked and limited conversation to collaborators on Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions