-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add the ability to pass arbitrary keyword arguments to the Pkg.test
function
#39
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #39 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 2 2
=========================================
Hits 2 2 Continue to review full report at Codecov.
|
0bae1ec
to
f169337
Compare
f169337
to
5f54fbb
Compare
I don't think this is the best approach, it's far too complicated. |
@SaschaMann If you are looking to implement #47, I think this PR was the right approach. In this PR, I was mainly unhappy about the use of |
@SaschaMann Do you want to take over this branch? |
I'll create a new one. My naive approach would have been to do something like - run: |
# The Julia command that will be executed
julia_cmd=( julia ${{ input.julia-args }} --color=yes --depwarn=${{ inputs.depwarn }} --inline=${{ inputs.inline }} --project=${{ inputs.project }} -e 'import Pkg;include(joinpath(ENV["GITHUB_ACTION_PATH"], "kwargs.jl"));kwargs = Kwargs.kwargs(;coverage = :(${{ inputs.coverage }}),force_latest_compatible_version = :(${{ inputs.force_latest_compatible_version }}), julia_args = ["${{ input.julia-test-args }} --check-bounds=${{ inputs.check_bounds }}"]);Pkg.test(; kwargs...)' ) Could you elaborate your reasoning behind the custom syntax for the input and your approach? |
Yeah. The goal of this PR was that we wouldn't lock ourselves into just supporting |
That's true. Do you happen to know if there are any plans to add more kwargs? To me that risk seems more managable than the complexity of this approach but I also don't know how often args to |
It occurs to me that there's actually two issues:
I'm hoping that we won't add too many more public kwargs to For new public kwargs, we can always add more For new non-public kwargs, I don't think we have any ability to support them at all (if we don't do the approach in this PR). Because we certainly can't make it part of the public API of this action if it's not part of the public API of Pkg.
But this PR is so complicated (or at least it looks complicated), and I don't know if the cost of the complexity is outweighed by the benefit of supporting non-public kwargs. |
I think if we document its status as non-public clearly, we can get away with it. We may end up with a bunch of deprecated/version-specific inputs in the long run but that may just be the price we have to pay.
I will have a think if and how we could simplify the approach but it's gonna take some time. |
This PR adds the ability to pass arbitrary keyword arguments to the
Pkg.test
function.Example usage:
Motivation
There may be keyword arguments to
Pkg.test
that we don't want to explicitly hardcode into thejulia-runtest
action. For example, on Julia nightly, there is currently aallow_earlier_backwards_compatible_versions
keyword argument that you can pass toPkg.test
(see https://github.com/JuliaLang/Pkg.jl/blob/f0731405b557b8c04788f7fc6ca03d5a2e673280/src/Pkg.jl#L181-L229 and JuliaLang/Pkg.jl#2439 for details).This keyword argument is experimental, and may be removed in future minor releases of Julia. Therefore, we don't want to explicitly hardcode it as an input to the
julia-runtest
action.This PR allows the user to provide arbitrary key-value pairs that are passed as keyword arguments to
Pkg.test
without needing to create new inputs for those keyword arguments.