我正在尝试在 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
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)