Hi,
Please see code below.
julia> pwd()
"C:\\home"
(@v1.8) pkg> generate HelloWorld
Generating project HelloWorld:
HelloWorld\Project.toml
HelloWorld\src\HelloWorld.jl
(@v1.8) pkg> activate c:\\home\\HelloWorld\\
Activating project at `c:\home\HelloWorld`
(HelloWorld) pkg> st
Installing known registries into `C:\home\usr\JULIA_DEPOT`
Project HelloWorld v0.1.0
Status `C:\home\HelloWorld\Project.toml` (empty project)
(HelloWorld) pkg> add PrettyTables@2.2.2
Updating registry at `C:\home\usr\JULIA_DEPOT\registries\General.toml`
Resolving package versions...
Installed Formatting ββββββββββββββββββ v0.4.2
Installed DataValueInterfaces βββββββββ v1.0.0
Installed DataAPI βββββββββββββββββββββ v1.14.0
Installed LaTeXStrings ββββββββββββββββ v1.3.0
Installed Crayons βββββββββββββββββββββ v4.1.1
Installed OrderedCollections ββββββββββ v1.5.0
Installed StringManipulation ββββββββββ v0.3.0
Installed Tables ββββββββββββββββββββββ v1.10.1
Installed Reexport ββββββββββββββββββββ v1.2.2
Installed IteratorInterfaceExtensions β v1.0.0
Installed TableTraits βββββββββββββββββ v1.0.1
Installed PrettyTables ββββββββββββββββ v2.2.2
Updating `C:\home\HelloWorld\Project.toml`
β [08abe8d2] + PrettyTables v2.2.2
Updating `C:\home\HelloWorld\Manifest.toml`
[a8cc5b0e] + Crayons v4.1.1
[9a962f9c] + DataAPI v1.14.0
[e2d170a0] + DataValueInterfaces v1.0.0
[59287772] + Formatting v0.4.2
[82899510] + IteratorInterfaceExtensions v1.0.0
[b964fa9f] + LaTeXStrings v1.3.0
[bac558e1] + OrderedCollections v1.5.0
β [08abe8d2] + PrettyTables v2.2.2
[189a3867] + Reexport v1.2.2
[892a3eda] + StringManipulation v0.3.0
[3783bdb8] + TableTraits v1.0.1
[bd369af6] + Tables v1.10.1
[56f22d72] + Artifacts
[b77e0a4c] + InteractiveUtils
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[de0858da] + Printf
[9a3f8284] + Random
[ea8e919c] + SHA v0.7.0
[9e88b42a] + Serialization
[8dfed614] + Test
[4ec0a83e] + Unicode
[e66e0078] + CompilerSupportLibraries_jll v1.0.1+0
[4536629a] + OpenBLAS_jll v0.3.20+0
[8e850b90] + libblastrampoline_jll v5.1.1+0
Info Packages marked with β have new versions available and may be upgradable.
Precompiling project...
16 dependencies successfully precompiled in 10 seconds
At this step, I create test/runtests.jl.
Then I run test as you can see below.
Notice that during the test it is usung PrettyTables v2.2.2
(HelloWorld) pkg> test
Testing HelloWorld
Status `C:\Users\gitboy\AppData\Local\Temp\1\jl_y1mtu7\Project.toml`
[25ccf548] HelloWorld v0.1.0 `C:\home\HelloWorld`
β [08abe8d2] PrettyTables v2.2.2
Status `C:\Users\gitboy\AppData\Local\Temp\1\jl_y1mtu7\Manifest.toml`
[a8cc5b0e] Crayons v4.1.1
[9a962f9c] DataAPI v1.14.0
[e2d170a0] DataValueInterfaces v1.0.0
[59287772] Formatting v0.4.2
[25ccf548] HelloWorld v0.1.0 `C:\home\HelloWorld`
[82899510] IteratorInterfaceExtensions v1.0.0
[b964fa9f] LaTeXStrings v1.3.0
[bac558e1] OrderedCollections v1.5.0
β [08abe8d2] PrettyTables v2.2.2
[189a3867] Reexport v1.2.2
[892a3eda] StringManipulation v0.3.0
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.10.1
[56f22d72] Artifacts `@stdlib/Artifacts`
[2a0f44e3] Base64 `@stdlib/Base64`
[b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
[8f399da3] Libdl `@stdlib/Libdl`
[37e2e46d] LinearAlgebra `@stdlib/LinearAlgebra`
[56ddb016] Logging `@stdlib/Logging`
[d6f4376e] Markdown `@stdlib/Markdown`
[de0858da] Printf `@stdlib/Printf`
[9a3f8284] Random `@stdlib/Random`
[ea8e919c] SHA v0.7.0 `@stdlib/SHA`
[9e88b42a] Serialization `@stdlib/Serialization`
[8dfed614] Test `@stdlib/Test`
[4ec0a83e] Unicode `@stdlib/Unicode`
[e66e0078] CompilerSupportLibraries_jll v1.0.1+0 `@stdlib/CompilerSupportLibraries_jll`
[4536629a] OpenBLAS_jll v0.3.20+0 `@stdlib/OpenBLAS_jll`
[8e850b90] libblastrampoline_jll v5.1.1+0 `@stdlib/libblastrampoline_jll`
Info Packages marked with β have new versions available and may be upgradable.
Testing Running tests...
Testing HelloWorld tests passed
Now I exit HelloWorld and return to the main environment.
I βdevβ HelloWorld then run the test.
(HelloWorld) pkg> activate
Activating project at `C:\home\usr\JULIA_DEPOT\environments\v1.8`
(@v1.8) pkg> dev c:\\home\\HelloWorld
Resolving package versions...
Installed PrettyTables β v2.2.3
Updating `C:\home\usr\JULIA_DEPOT\environments\v1.8\Project.toml`
[25ccf548] + HelloWorld v0.1.0 `c:\home\HelloWorld`
Updating `C:\home\usr\JULIA_DEPOT\environments\v1.8\Manifest.toml`
[a8cc5b0e] + Crayons v4.1.1
[9a962f9c] + DataAPI v1.14.0
[e2d170a0] + DataValueInterfaces v1.0.0
[59287772] + Formatting v0.4.2
[25ccf548] + HelloWorld v0.1.0 `c:\home\HelloWorld`
[82899510] + IteratorInterfaceExtensions v1.0.0
[b964fa9f] + LaTeXStrings v1.3.0
[bac558e1] + OrderedCollections v1.5.0
[08abe8d2] + PrettyTables v2.2.3
[189a3867] + Reexport v1.2.2
[892a3eda] + StringManipulation v0.3.0
[3783bdb8] + TableTraits v1.0.1
[bd369af6] + Tables v1.10.1
[56f22d72] + Artifacts
[2a0f44e3] + Base64
[b77e0a4c] + InteractiveUtils
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[de0858da] + Printf
[9a3f8284] + Random
[ea8e919c] + SHA v0.7.0
[9e88b42a] + Serialization
[8dfed614] + Test
[4ec0a83e] + Unicode
[e66e0078] + CompilerSupportLibraries_jll v1.0.1+0
[4536629a] + OpenBLAS_jll v0.3.20+0
[8e850b90] + libblastrampoline_jll v5.1.1+0
(@v1.8) pkg> test HelloWorld
Testing HelloWorld
Status `C:\Users\gitboy\AppData\Local\Temp\1\jl_iqmo6U\Project.toml`
[25ccf548] HelloWorld v0.1.0 `c:\home\HelloWorld`
[08abe8d2] PrettyTables v2.2.3
Status `C:\Users\gitboy\AppData\Local\Temp\1\jl_iqmo6U\Manifest.toml`
[a8cc5b0e] Crayons v4.1.1
[9a962f9c] DataAPI v1.14.0
[e2d170a0] DataValueInterfaces v1.0.0
[59287772] Formatting v0.4.2
[25ccf548] HelloWorld v0.1.0 `c:\home\HelloWorld`
[82899510] IteratorInterfaceExtensions v1.0.0
[b964fa9f] LaTeXStrings v1.3.0
[bac558e1] OrderedCollections v1.5.0
[08abe8d2] PrettyTables v2.2.3
[189a3867] Reexport v1.2.2
[892a3eda] StringManipulation v0.3.0
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.10.1
[56f22d72] Artifacts `@stdlib/Artifacts`
[2a0f44e3] Base64 `@stdlib/Base64`
[b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
[8f399da3] Libdl `@stdlib/Libdl`
[37e2e46d] LinearAlgebra `@stdlib/LinearAlgebra`
[56ddb016] Logging `@stdlib/Logging`
[d6f4376e] Markdown `@stdlib/Markdown`
[de0858da] Printf `@stdlib/Printf`
[9a3f8284] Random `@stdlib/Random`
[ea8e919c] SHA v0.7.0 `@stdlib/SHA`
[9e88b42a] Serialization `@stdlib/Serialization`
[8dfed614] Test `@stdlib/Test`
[4ec0a83e] Unicode `@stdlib/Unicode`
[e66e0078] CompilerSupportLibraries_jll v1.0.1+0 `@stdlib/CompilerSupportLibraries_jll`
[4536629a] OpenBLAS_jll v0.3.20+0 `@stdlib/OpenBLAS_jll`
[8e850b90] libblastrampoline_jll v5.1.1+0 `@stdlib/libblastrampoline_jll`
Precompiling project...
2 dependencies successfully precompiled in 7 seconds. 14 already precompiled.
Testing Running tests...
Testing HelloWorld tests passed
Notice how it is now using PrettyTables 2.2.3.
I have added in the Project.toml file a section
[compat]
PrettyTables = "2.2.2"
But still when I run test HelloWorld
it still uses version 2.2.3 of PrettyTables. Why is that?
Is there a way to constrain the version?
Thank you