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

Handle version of JET when testing on several versions of Julia #546

Open
gdalle opened this issue Jun 26, 2023 · 1 comment
Open

Handle version of JET when testing on several versions of Julia #546

gdalle opened this issue Jun 26, 2023 · 1 comment

Comments

@gdalle
Copy link

gdalle commented Jun 26, 2023

When I test my packages, I use several versions of Julia: LTS (currently 1.6), release (1.9) and nightly (1.10). I only use JET on release and nighty, and for these two I want the latest version of JET (0.8.3).
If I put a recent compat bound on JET in the Project.toml, Julia LTS will complain that it cannot install it, and my CI will fail. I don't think it is currently possible to have compat bounds that depend on the Julia version. So for now, my workaround is the following:

using Pkg
using JET

function get_pkg_version(name::AbstractString)
    for dep in values(Pkg.dependencies())
        if dep.name == name
            return dep.version
        end
    end
    return error("Dependency not available")
end

@testset "Code quality (JET.jl)" begin
    if VERSION >= v"1.9"
        @assert get_pkg_version("JET") >= v"0.8.3"
        JET.test_package(Graphs; target_defined_modules=true)
    end
end

Is there a more elegant approach? Should this maybe be documented?

@aviatesk
Copy link
Owner

There is no proper support for 1.6 so that is probably the best way to workaround the compat problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants