在Windows上本地安装包的Conda构建R包

时间:2017-05-24 20:07:47

标签: r package conda

我正在尝试在Windows上的Conda中构建自定义R包。源是本地github仓库,因为远程仓库是私有的。一切似乎都很顺利,但是程序包的大小最终为9kb,并且在构建期间安装在本地计算机上。也就是说,上传到Anaconda.org的可安装版本除了激活和停用脚本之外不包含任何内容。所以,我希望能够为其他人构建软件包,但它似乎只是在我的本地机器上构建(到本地机器的R库文件夹,它已经存在!)。

从大量的研究中,我认为我需要在yaml或bld.bat文件中设置前缀,但我不知道如何做到这一点。任何帮助将不胜感激。我通过这个过程学习了很多关于Conda的知识,所以我希望我的问题能够得到很好的定义。

我的meta.yaml看起来像这样:

{% set version = '0.0.0.9000' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: my_package
  version: {{ version|replace("-", "_") }}

source:
  fn: my_package_{{ version }}
  url: C:/_github/subdirectory/my_package
build:
  # If this is a new build for the same version, increment the build number.
  number: 0

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/


requirements:
  build:
    - r-base
    - r-roxygen2
    - r-scales
    - r-jsonlite
    - r-foreign
    - r-ggplot2 >=2.1.0  
    - r-ca
    - r-openxlsx
    - r-plotly
  run:
    - r-base
    - r-roxygen2
    - r-scales
    - r-jsonlite
    - r-foreign
    - r-ggplot2 >=2.1.0  
    - r-ca
    - r-openxlsx
    - r-plotly

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('package')"  # [not win]
    - "\"%R%\" -e \"library('package')\""  # [win]

bld.bat看起来像这样:

"%R%" CMD INSTALL --build .
if errorlevel 1 exit 1

0 个答案:

没有答案
相关问题