aviatesk / juliacon2021-workshop-pkgdev

The repository for JuliaCon2021 workshop "Package development: improving engineering quality & latency"
33 stars 5 forks source link

add JET.jl workshop #3

Closed aviatesk closed 3 years ago

aviatesk commented 3 years ago

Since I'd like to do some live coding with MacroTools.jl, I ended up adding it as submodule.

It might be problematic, because then we can't instantiate this project without git sudmodule init && git submodule update (because JET depends on MacroTools.jl). I of course added the instructions, but we may want to remove it entirely, and just let users to dev it MacroTools.jl.

timholy commented 3 years ago

I want to do a Flux demo too, that's funny.

Can we just add Flux & FluxML to the Project.toml, [compat] to a specific version? You can dev it for your section and if needed I can tell them tofree it for mine.

aviatesk commented 3 years ago

dev will try to pull the latest commit, so I wondered we lose the reproducibility in the future, but that should be enough at least for our workshop. But I think submodules can be really problematic after all, so I'm going with your suggestion.

timholy commented 3 years ago

PackageSpec allows you to specify a git commit SHA1, maybe we can use that?

aviatesk commented 3 years ago

Thanks for your review !

As for package development stuff, Pkg.dev actually doesn't allow us to checkout to a specific git commit SHA1, and on Slack I got a recommendation of manual checkout.

FWIW, this is what I included within a notebook:

using Pkg

Pkg.develop("MacroTools")

let back = pwd()
    try 
        path = Base.find_package("MacroTools")
        cd(dirname(dirname(path)))
        run(`git checkout -b juliacon fef1c6fab11f30d6ae1c1fff6c42be49ccef5d10`)
    catch err
        @warn "please manually checkout to fef1c6fab11f30d6ae1c1fff6c42be49ccef5d10"
        throw(err)
    finally
        cd(back)
    end
end

We may need to Pkg.rm("MacroTools"); Pkg.resolve() after the live coding though.