Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document two new ways of specifying test-specific dependencies #3953

Open
mgkuhn opened this issue Jul 16, 2024 · 0 comments
Open

Document two new ways of specifying test-specific dependencies #3953

mgkuhn opened this issue Jul 16, 2024 · 0 comments

Comments

@mgkuhn
Copy link
Contributor

mgkuhn commented Jul 16, 2024

The Test-specific dependencies section of the documentation currently only lists two older methods for specifying test-specific dependencies:

  • [targets] + [extras] in main Project.toml
  • test/Project.toml: add only additional dependencies there

Both of these older methods have been somewhat unsatisfactory: they only work via special magic applied by Pkg.test(), and they do not work if one simply tries to activate a local test environment with julia --project=test/ runtests.jl.

Fortunately there are now two new, alternative, better ways of solving this problem, which do not rely on special magic applied by Pkg.test(), and these finally allow the test folder to be just a normal project:

  • [source] in test/Project.toml: under [deps] add ProjectName=UUID as a dependency and under [source] also add ProjectName={path='..'} such that the cd test/ && julia --project environment finds the project to test in its own parent folder
  • [workspace] in Project.toml: add projects = ["test"] such that the test environment finds the project to test in its own parent folder

At the moment, these new features are still hidden in the Project.toml format description

It would be great to have these documented as well under https://pkgdocs.julialang.org/dev/creating-packages/#Test-specific-dependencies

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

No branches or pull requests

1 participant