Travis: Cannot add package with the same name or uuid as the project

I am trying to set up a new package. I am using what I believe to be a standard Travis script as per

- julia -e 'using Pkg; Pkg.add(pwd());"ImagePhaseCongruency"); Pkg.test("ImagePhaseCongruency"; coverage=true)'

However I end up with the error

ERROR: Cannot add package with the same name or uuid as the project

I have no understanding of how the error comes about, or how I might address it. I have, indeed, been developing the package in a project of the same name but this would appear to be the standard thing to do as suggested in the documentation

To avoid the Pkg.clone() deprecation message I have also been using

 - julia -e 'using Pkg; Pkg.add(PackageSpec(url=""));"ImagePhaseCongruency"); Pkg.test("ImagePhaseCongruency"; coverage=true)'

This results in the same error on Travis. However when I run this command from a terminal directly on my machine using a bare installation of v1.0.1 with no packages installed it does result in a successful build of my package.

Looking at other (somewhat dated) mentions of this error in Discourse don’t seem to give me any clues. I presume I am missing something simple and obvious.

What you quote here is not in that file though? Example.jl uses the default script defined here: which boils down to the following on Julia v0.7/v1.0 (if you have a Project.toml file):

julia --color=yes -e 'using Pkg;'
julia --check-bounds=yes --color=yes -e 'using Pkg; Pkg.test(coverage=true)'

This happens because Travis runs with pwd set to the already cloned repo. And you are thus trying to add the package to the package itself, hence the error. You can mimic this locally by starting Julia in your package folder as julia --project=@. which will start julia with the package as its “active project”.

1 Like

Thank you so much! I was just about in tears trying to get things to go. Re-reading the Pkg documentation I can now (start to) see how things work with the new Project framework. However ultimately I feel some more documentation and examples would be useful for noobs such as me. Also, I have not been able to find where the --project switch is documented nor is it listed when you run julia --help. Anyway, thanks once again!

1 Like

Yea, fortunately this has now been documented, and it should be in the upcoming v1.0.2 release. (See, and