JuliaGaussianProcesses / KernelFunctions.jl

Julia package for kernel functions for machine learning
https://juliagaussianprocesses.github.io/KernelFunctions.jl/stable/
MIT License
267 stars 32 forks source link

Make Test a weak dependency #521

Open devmotion opened 1 year ago

devmotion commented 1 year ago

I'm not sure if this is a good idea at all and if it works as intended - BUT I've encountered multiple repos in the last few months where people did not want to add dependencies on Test. So I was wondering if we could get away with making the test utilities an extension of the package and wanted to try it in KernelFunctions.

IMO, the main problems are that 1) the code is a bit more complex and contains a "workaround" (since only overloaded but not new functions in extensions are accessible for the user) and 2) the extension is always loaded when testing the PR in the REPL.

I assume the reason for 2) might be that the Test stdlib is included in the default system image (?). Or are stdlibs not supported as weakly dependencies (I guess @KristofferC should know this?)?

codecov[bot] commented 1 year ago

Codecov Report

Attention: 74 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/KernelFunctions.jl 100.00% <ø> (ø)
src/TestUtils.jl 100.00% <100.00%> (+6.75%) :arrow_up:
ext/KernelFunctionsTestExt.jl 0.00% <0.00%> (ø)

... and 30 files with indirect coverage changes

:loudspeaker: Thoughts on this report? Let us know!.

devmotion commented 10 months ago

This approach was adopted by eg AbstractFFTs, TranscodingStreams, and (soon) Distributions. I think we should make Test a weak dependency to reduce the number of dependencies and to be nice to other packages that made Test a weak dependency.

willtebbutt commented 10 months ago

I agree that we should do this -- I'm contemplating doing it with some of my other repos as well anyway.