Skip to content

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Apr 11, 2025

Closes #3460

(Pkg) pkg> activate /Users/ian/Documents/GitHub/ObjectDetector.jl
  Activating project at `~/Documents/GitHub/ObjectDetector.jl`

(ObjectDetector) pkg> activate --test
    Creating temporary project based on the target `test` in `~/Documents/GitHub/ObjectDetector.jl/Project.toml`
  Activating project at `/var/folders/1z/jf841bdj73bdj3vk7kc7f_3w0000gn/T/jl_wHY4q9`

(jl_wHY4q9) pkg> st
Status `/private/var/folders/1z/jf841bdj73bdj3vk7kc7f_3w0000gn/T/jl_wHY4q9/Project.toml`
  [79e6a3ab] Adapt
  [5c00bae2] AllocArrays
  [6e4b80f9] BenchmarkTools
  [052768ef] CUDA
  [e2912957] Darknet
  [5789e2e9] FileIO
  [587475ba] Flux
  [a09fc81d] ImageCore
  [4381153b] ImageDraw
  [6a3955dd] ImageFiltering
  [82e4d734] ImageIO
  [02fcd773] ImageTransformations
  [aea7be01] PrecompileTools
  [08abe8d2] PrettyTables
  [324d217c] ReferenceTests
  [a759f4b9] TimerOutputs
  [c4a57d5a] UnsafeArrays
  [02a925ec] cuDNN
  [4af54fe1] LazyArtifacts
  [8dfed614] Test

TODO:

  • Fix including the parent package in the temp env

@davidanthoff
Copy link

This would be amazing to have! Lots of use for it in the VS Code extension. Probably too late for 1.12?

@IanButterworth
Copy link
Member Author

IanButterworth commented Jun 24, 2025

@KristofferC mentioned in #3460 that the new workspaces feature was a better way to handle this in 1.12+

We could add this functionality, or we could not and focus on prodding people towards using workspaces in 1.12+.

It came up in the #testing slack channel that this section of the docs should be updated to highlight workspaces being the best way to do test envs. https://pkgdocs.julialang.org/v1/creating-packages/#Alternative-approach:-test/Project.toml-file-test-specific-dependencies

@IanButterworth
Copy link
Member Author

Also so I don't forget if we go with this PR.. there's a bug. It's currently not including the parent package in the test env.

@davidanthoff
Copy link

It would still be great to have just one function that handles all the complexities of deciding how to set up the test env. I.e. if the workspace is there, is that, if the old style separate Project.toml is there, us that, or the target thing. We will essentially have three different ways to specify test env in 1.12 that all need to be supported, and it would be nice if Pkg.jl handled all cases.

@github-project-automation github-project-automation bot moved this to New in Pkg.jl Jul 2, 2025
@IanButterworth IanButterworth moved this from New to In progress in Pkg.jl Jul 2, 2025
@Moelf
Copy link
Contributor

Moelf commented Jul 30, 2025

with workspaces, this should be expanded to be able to activate any workspace or...? --docs would be useful, and --benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

TestEnv.jl functionality/support
3 participants