Closed oxinabox closed 5 months ago
A counter argument to this is that folk should stop using the [extras]/[targets] section and use test/Project.toml. However myself and I know many others actually prefer everything in one file -- makes it harder to mistakenly do funny things with [compat].
One of the reasons why I strongly prefer test/Project toml
is that it clearly separates the meaning of [compat]
. Both with the proposed scheme and the previous [extras]
there is a UX ambiguity. Do compat
bounds to dependencies in [extras]
/[test]
impact resolution of a package during normal installation?
For some users the answer may be clear: Of course it doesn't those compat bounds are only applied when tests are instantiated. For other users this may not be clear and can lead to confusion, and extra cognitive overhead when needing to check if a stated compat bound is applicable (is it just a test dependency?)
I believe the original design for [extras]
was that there could be more than one test target, but that use case never materialized.
Overall I am not yet convinced that the pain of migration is worth the extra effort (and I personally would prefer going all in on test/Project.toml
)
Note that you can have both test
and build
targets
Huh, I never knew that. I think that makes this a nonstarter. I guess that's rarely used since BinaryProvider kind of overtook it. Especially when it became a stdlib in 1.3
@nickrobinson251 asked me to write this up
Right now in order to use a test time dependency you need to
[extras]
test
array under[targets]
This duplication of information is annoying. Not very annoying but a little annoying.
[extras]
right now is only used for listing names and UUIDs of test time dependencies. Nothing else. It seems like we just don't need the extra listing of all their names again intargets.test
.Concerns:
One thing that is different between the lists (at least in theory) is that on some version of julia you can list things in
targets.test
that are not in[extras]
if they are in[weakdeps]
. At least according to manual, but it doesn't say what versions. Idk if anyone is relying on this.A counter argument to this is that folk should stop using the
[extras]
/[targets]
section and usetest/Project.toml
. However myself and I know many others actually prefer everything in one file -- makes it harder to mistakenly do funny things with[compat]
.Deprecation path
Proposal 1.
We would continue to allow
[extras]
but it would just be an alias for[test]
. And we would continue to allow[targets]
but it would just be ignored -- even if you used it with[extras]
we would still treat the list under[extras]
as the list of things to install for runningPkg.test
. This would technically i think result in some code which lists things in[extras]
but doesn't list them intargets.test
to download extra files. But having such extra entries in[extras]
is probably only occurring by mistake, and it will have no observable effect on the actual running of the code.Proposal 2.
We would continue to allow
[extras]
but it would just be an alias for[test]
. Iftargets.test
is present then we would use it as present. Otherwise we would just automatically populate it withkeys(test)
. This has the advantage that we would allow people to continue not listing[weakdeps]
in[extras]
.Example
To make it concrete my proposal would change Project.toml as follows:
before
after
diff