I have a package with the usual structure, but I also have examples here, because I believe runnable code is more useful than snippets in md.
So the structure is something like
Project.toml is there accoring to the Pkg docs:
and I really like the notion of nested directories where test has some additional dependencies next to the project itself.
And my question is: how to achieve the same thing with examples?
So I would have a Project.toml in examples with some additional dependencies needed to run them, but not needed in the package itself.
Is there a way to do it?
So far I didn’t figure anything out, and having a separate repo for examples which is just few (2-3 scripts) seems like an overkil, but I’m open to any solution that would let me specify the deps for examples without flodding the library itself with garbage.
What I do is (
pwd is the project folder )
pkg> activate examples
pkg> dev <Name of the Module>
pkg> add <Additional dependencies>
This will create the Project and Manifest-files in the examples directory.
Thanks, I tried that, but this package I’m working on is not in registry yet, so the
dev <package> crashed.
I would like to use the source code I have in the project, not download it again.
It shouldn’t need to be registered. Try giving a path, maybe even
pkg> dev . could work.
Also look at this related thread:
(I apologize in advance for the very long post)
As I use Julia for ever more complex and complete projects, I seem to run into the following problem, where a single “project” contains lots of related code, which will be used in different contexts to perform different tasks. (I’m speaking here of a “project” in the Github sense; from here on let’s imagine I’m speaking of a git repository, and reserve the words “package” and “project” to express the Julia concepts defined in the Pkg.jl documentat…
Some of the (sometimes prospective) solutions mentioned there might be of some interest to you:
dev . it worked exactly as I wanted.