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

Clarify test dependencies paragraph by moving note about the "old" version #3533

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/src/creating-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,13 @@ test-specific dependencies, are available, see below.
There are two ways of adding test-specific dependencies (dependencies that are not dependencies of the package but will still be available to
load when the package is tested).

#### `target` based test specific dependencies
!!! note
The exact interaction between `Project.toml`, `test/Project.toml` and their corresponding
`Manifest.toml`s are not fully worked out and may be subject to change in future versions.
The old method of adding test-specific dependencies, which relies on `target`, will
therefore be supported throughout all Julia 1.X releases.

#### `target`-based test-specific dependencies

Using this method of adding test-specific dependencies, the packages are added under an `[extras]` section and to a test target,
e.g. to add `Markdown` and `Test` as test dependencies, add the following:
Expand All @@ -204,20 +210,14 @@ test = ["Markdown", "Test"]

to the `Project.toml` file. There are no other "targets" than `test`.

#### `test/Project.toml` file test specific dependencies

!!! note
The exact interaction between `Project.toml`, `test/Project.toml` and their corresponding
`Manifest.toml`s are not fully worked out and may be subject to change in future versions.
The old method of adding test-specific dependencies, described in the next section, will
therefore be supported throughout all Julia 1.X releases.
#### `test/Project.toml` file test-specific dependencies

is given by `test/Project.toml`. Thus, when running
In this new method, the test dependencies are given by `test/Project.toml`. Thus, when running
tests, this will be the active project, and only dependencies to the `test/Project.toml` project
can be used. Note that Pkg will add the tested package itself implicitly.

!!! note
If no `test/Project.toml` exists Pkg will use the `target` based test specific dependencies.
If no `test/Project.toml` exists Pkg will use the `target`-based test-specific dependencies.

To add a test-specific dependency, i.e. a dependency that is available only when testing,
it is thus enough to add this dependency to the `test/Project.toml` project. This can be
Expand Down