I’m having some troubles in testing a package I’m developing.
I have the current official version of the package taken from git repository (using “add” command), stored in `.julia/packages/MyPackage.
I also downloaded MyPackage for development (using “dev” command), which is stored locally in .julia/dev/MyPackage, and I modified it.
I want to test the modified package.
The point is that the line
using Mymodule
in test/runtests.jl is calling the older version of the package stored in .julia/packages, and not the one in the working directory.
Probably I don’t fully understand the new package manager.
I think you may have freeed the package again, it then uses the .julia/packages/MyPackage. What happens if you first dev MyPackage and then test MyPackage?
@mauro3’s suggestion is the right way to fix the problem. For diagnosing this kind of problem, it may be handy to pointing out the existence of pathof:
help?> pathof
search: pathof
pathof(m::Module)
Return the path of m.jl file that was used to import module m, or nothing if m was not imported from a package.
Use dirname to get the directory part and basename to get the file name part of the path.
following @mauro3 suggestion, I tried to do dev MyPackage, with the following error:
ERROR: expected a 'name' entry in project file at .julia/dev/MyPackage/Project.toml
and then I realized that the lines:
name = "MyPackage"
uuid = "....."
were missing in Project.toml file!
That’s because I didn’t create a new package using “generate MyPackage”, but I downloaded an already existing package to modify it. And this package was created with a previous version of Julia (0.6) and originally had not the Project.toml file.
That’s what apparently caused the problem!