How to generate Project.toml and Manifest.toml for a repository for be executed with Binder

I have a local folder that contains a subfolder with two jl files, and a few Jupyter Notebooks in the root.
I intend to push it to a github repository to use Binder for running the notebooks.
My notebooks are using a few Julia packages like StaticArrays, etc, and some notebooks include my own jl files from the subfolder. At this moment
these files are accessed like this:

include("utils/myfile.jl")

I don’t know how to generate the Project.toml and Manifest.toml for this future repository.
In order to pass to Binder the deps how should be added all used Julia packages and my own jl files?

There are two options to start creating a package:

  1. 5. Creating Packages · Pkg.jl
  2. GitHub - invenia/PkgTemplates.jl: Create new Julia packages, the easy way

These will create an environment for your package.

Also, you can use ] activate <path to folder> to initialize or activate an environment such as the one created by the above. You can then do ] add StaticArrays which will then populate the Project.toml and Manifest.toml.

Also see 4. Working with Environments · Pkg.jl

1 Like

Thank you, @mkitti ! One aspect is not yet clear: my jl files from the subdirectory should be added to project, pointing out the path to them?

If you have a folder “MyPkgFoo”, then the recommended thing is to have a file in that folder “src/MyPkgFoo.jl” which contains

module MyPkgFoo
    include("bar.jl")
    include("../utils/myfile.jl")
end
1 Like