Good idea!
Indeed, stacking the “superproject” environment with the environment defined by a “subproject” would probably be ideal.
I don’t either. Maybe we lack some tooling and/or documentation in this area.
Here is an attempt fiddling with LOAD_PATH
. The following tests are run in a directory with the following files:
.
├── Manifest.toml
├── Project.toml -> deps: LinearAlgebra
└── SubProject
├── Manifest.toml
└── Project.toml -> deps: BenchmarkTools
shell> julia --project --quiet
# Restrict LOAD_PATH so that we don't have access to the home environment
julia> splice!(LOAD_PATH, 1:length(LOAD_PATH)); push!(LOAD_PATH, "@")
1-element Array{String,1}:
"@"
# BenchmarkTools is not defined as a dependency of the top-level project
julia> using BenchmarkTools
ERROR: ArgumentError: Package BenchmarkTools not found in current path:
- Run `import Pkg; Pkg.add("BenchmarkTools")` to install the BenchmarkTools package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:823
# However it is a dependency of the SubProject
julia> push!(LOAD_PATH, "SubProject")
2-element Array{String,1}:
"@"
"SubProject"
julia> using BenchmarkTools
julia>