How to set up Travis dependency for an external unregistered package?

travis
#1

This is typical problem I have when working with GitHub and the solution seems to be undocumented:

  • I have an unregistered package A on GitHub
  • I have an unregistered package B on GitHub
  • the package B references the package A

When testing package B locally I can typically issue a command such as Pkg.add(PackageSpec(url="https://github.com/pszufe/A.jl")) and then run tests.

However, I do not know what is the standard practice for the .travis.yml for the package B?

Now I just add to every place in .travis.yml the command above but it looks kind of ugly.

This also means that I can not run the default Julia Travis configuration (this is the one that executes command julia --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.clone(pwd()); Pkg.build(\"${JL_PKG}\"); else using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(verbose=true); else Pkg.build(); end; end") because it will obviously fail with the A has no known versions! message.

I also tried running Pkg.add on activated B package but the modifications made to the *.toml files do not seem to help Travis to successfully build.

Is there any nice Julian way to configure such dependency or am I forced to poke Pkg.add(PackageSpec(url="..")) everywhere?

#2

Commit your Manifest.toml and you are good to go.

You most certainly can.

1 Like
#3

I tried this few times but then I was getting this A has no known versions! and restricted to versions * by an explicit requirement — no versions left message. Having such information message does not help to debug.

Are there any other things that determine whether it works or does not work?

#4

Are the repositories public?

As long as you have committed B/Manifest.toml and A is in it with the correct information it should work.

#5

Are the repositories public?

yes, but they ended up with Pkg.add(PackageSpec(url="..")) lines in Travis :slight_smile:

maybe I will retry with B/Manifest.toml and when it crashes post a link…

#6

@fredrikekre yes, that works!

You just have to remember to remove all those Pkg.add(...) lines from Travis