简体   繁体   English

由于明显的循环软件包依赖性,travis构建失败

[英]travis build failing because of an apparent circular package dependency

I have an R package A and a package B . 我有一个R包A和一个B包。 The package B genuinely depends on A for some of its functions. 软件包B确实依赖于A的某些功能。 The package A depends on B , but only for testing. 程序包A取决于B ,但仅用于测试。 So the package dependency is not genuinely circular. 因此,包依赖关系并不是真正的循环。

The travis build fails for A because upon installing A it tries to install B only to find A is not installed. travis构建对于A失败,因为在安装A时它试图安装B只是发现未安装A。

How can I tell travis not to worry about B until it starts testing? 在开始测试之前,如何告诉travis不要担心B

My thoughts are to: 我的想法是:

  • Put all of B 's dependencies in A , leaving B independent. B的所有依赖项放在A中 ,使B独立。
  • Leave off the dependency of A on B , and construct the test as if B didn't exist. 放弃AB的依赖关系,并像B不存在那样构造测试。

But both seem as drastic as abandoning unit testing. 但是,两者似乎都像放弃单元测试一样激烈。

I've mocked up an minimum reproducible example: 我已经模拟了一个最小的可重现示例:

https://github.com/HughParsonage/AAAA https://github.com/HughParsonage/AAAA

https://github.com/HughParsonage/BBBB https://github.com/HughParsonage/BBBB

When I push AAAA to travis, I get: 当我将AAAA推向travis时,我得到:

ERROR: dependency 'AAAA' is not available for package 'BBBB' 错误:依赖项“ AAAA”不适用于程序包“ BBBB”

removing '/usr/local/lib/R/site-library/BBBB' 删除'/ usr / local / lib / R / site-library / BBBB'

Error: Command failed (1) 错误:命令失败(1)

Execution halted 执行停止

My actual packages are 我实际的包裹是

A : https://github.com/HughParsonage/grattan Ahttps : //github.com/HughParsonage/grattan

B : https://github.com/HughParsonage/taxstats Bhttps : //github.com/HughParsonage/taxstats

I suspect you know the answer to this: Just avoid the circular dependency. 我怀疑您知道答案:避免循环依赖。

There just was an insightful and detailed discussion about a very related situation on the r-devel list in this thread . 在该线程r-devel列表上,只有一个非常相关的情况,就此进行了深入而详尽的讨论。 You a look at the discussion there; 您看那里的讨论; several options were proposed and the original poster was somewhat convinced -- just like you here -- that the standard laws of gravity would not apply to them. 提出了几种选择,并且原始的发布者在某种程度上说服了-就像您在这里一样-标准重力定律不适用于它们。

I would just avoid the problem and put the commonalities into a new package pkgC upon which pkgA and pkgB can depend, or even just suggest it. 我只是避免这个问题,并将共同点放在新的软件包pkgCpkgApkgB可以依靠它,甚至只是提出建议。 Another simply solution (also proposed in the thread) is to just merge pkgA and pkgB . 另一个简单的解决方案(也在线程中提出)是仅合并pkgApkgB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM