I have created two packages created as follows.
(1) Create PackageA
step1: generate PackageA
step2: add code
step3: cd PackageA
dev . # deploy PackageA
(2) Create PackageB depending on PackageA
step1: generate PackageB
step2: add code
step3: cd PackageB
dev . # deploy PackageB
step4: activate .
step5: add PackageA #error in this line as follows
ERROR: The following package names could not be resolved: PackageA (not found in project or manifest) Please specify by known
name=uuid.
The command,
Pkg> st
can show the PackageA and PackageB.
Also, i can run “using PackageA”
Is this the right way to deploy the user-defined package, which depending on another one?
Thanks
You need to add
or better dev
PackageA
while PackageB
’s environment is active.
You need to use the local path to PackageA
when issuing the dev
.
The syntax depends on whether you do >pkg dev
or Pkg.develop
.
>pkg dev /path/to/PackageB
is one option.
I think it would be easiest if you look up the details here.
Thanks! It works. I add the relative path to the command
I first edit the Manifest.toml and Project.toml and add dependency information of PackageA
Then, run
PackageB> instantiate
The following step update the manually added contents in Manifest.toml, add more information
PackageB> add PackageA …/PackageA #without the first two steps, this can not run;
In the Manifest.toml, it use the relative path and works.
The notes you suggested is very helpful. Thanks!
Perhaps I misunderstand what you wrote, but do not hand-edit Project.toml or Manifest.toml.
The only thing you should have to do is
- activate PackageB
>pkg dev /path/to/PackageA
Everything else is automatic. There is no need to instantiate
anything (at least assuming your code is already in JULIA_PKG_DEVDIR
(~/.julia/dev by default); it should be).
I don’t really understand your second to last paragraph about PackageB> add
etc.
Thanks for your suggestion. I created two packages PackageA and PackageB, which is not a git directory. PakcageB depends on PackageA. I want to install PackageA and PackageB. I solve this by edit Manifest.toml and Project.toml according to the notes. It works well. Thanks!