I was testing a package and want to set the package as my project directory for test.
When I pass my relative path ~/.julia/dev/Gym/
as --project=
, the following error occurs.
vish@eliteone:~/.julia/dev/Gym$ julia --project=~/.julia/dev/Gym/ -e "using Pkg; Pkg.test(\"Gym\")" --color=yes
ERROR: The following package names could not be resolved:
* Gym (not found in project or manifest)
Please specify by known `name=uuid`.
Stacktrace:
[1] pkgerror(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
[2] #ensure_resolved#72(::Bool, ::Function, ::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1010
[3] ensure_resolved at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:981 [inlined]
[4] #test#44(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:189
[5] test at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:178 [inlined]
[6] #test#43 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
[7] test at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
[8] #test#42 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
[9] test at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
[10] #test#41(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
[11] test(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
[12] top-level scope at none:0
However if I specify the full path, it works.
vish@eliteone:~/.julia/dev/Gym$ julia --project=/home/vish/.julia/dev/Gym/ -e "using Pkg; Pkg.test(\"Gym\")" --color=yes
Testing Gym
Resolving package versions...
Test Summary: | Pass Broken Total
Spaces | 82 12 94
Testing Gym tests passed
How can I expand “~” for setting project automatically?