JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
610 stars 251 forks source link

Always develop the local package in `test/Project.toml`, `docs/Project.toml` #3816

Closed olynch closed 2 months ago

olynch commented 4 months ago

One thing that constantly trips me up over and over again is that I have to remember to run julia --project=test -e 'import Pkg; Pkg.develop(".")' and julia --project=docs -e 'import Pkg; Pkg.develop(".")' before I run any tests or edit the docs. My understanding is that it's not best practice to check in Manifest.toml, which would be one way to resolve this. Would it be possible to add a field to the Project.toml in docs and test to always be based on the local version?

aplavin commented 4 months ago

Probably, TestEnv.jl will help: its goal is exactly to activate the test environment in a consistent way. I personally never see the need to write

julia --project=test -e 'import Pkg; Pkg.develop(".")'

KristofferC commented 2 months ago

I would say that this is kind of fixed by either using a workspace, or by adding a [sources] entry to the Project file pointing to the package.