Closed ctkelley closed 3 months ago
Yep! You can add it as a test dependency, and then use these functions in your tests: https://ericphanson.github.io/ExplicitImports.jl/stable/api/#Usage-in-testing
That's not exactly what I had in mind. My runtests.jl
file is not a module, but begins with several using
statements. Can I figure out what the implicit imports in my test suite are?
Ah I see. You could try: print_explicit_exports(Main, "test/runtests.jl")
. Let me know if that works, maybe we can document it or add a shortcut for main.
Thanks!
I assume you meant
print_explicit_imports(Main, "test/runtests.jl")
That did the job, but then I got several things about Base. Several lines of stuff like this.
Module Base is not relying on any implicit imports.
Module Base.GMP.MPQ is not relying on any implicit imports.
Module Base.StackTraces is not relying on any implicit imports.
Module Base.__toplevel__ is not relying on any implicit imports.
Module Base.Ryu is not relying on any implicit imports.
Ok good to know, we can probably provide a “script” entry point that can filter stuff like that out and be usable for this
The reason Base shows up is basically https://github.com/JuliaLang/julia/issues/53574. But we can filter it out manually.
v1.2 is out with print_explicit_imports_script
that should cover this! Let me know if you run into issues.
That did the job. Thanks for responding to this so fast.
This package is great stuff. Is there a way to run it on the
runtests.jl
script you use for CI?