AttoBot for Pkg3 projects

question

#1

Currently, new packages that only supports v0.7+ will not need the REQUIRE file, however attobot will require a REQUIRE file, how should I register (and maybe update) the package then? Or should I add a REQUIRE according to Project.toml?


#2

For the moment, yes, use REQUIRE files and register to METADATA.


#3

Is it OK to add a REQUIRE in addition to Project.toml, with of course identical contents (except for standard libraries)?


#4

Yes.


#5

Is there a timeframe for dropping the requirement for REQUIRE for registered packages? The 1.0 manual does not even mention it, yet it is still required in practice for package registration.

Just asking because if it will be with us in the medium run, I would just generate REQUIRE from Project.toml using a git hook.


#6

My current workaround is the script

#!/usr/bin/env julia
######################################################################
# Overwrite REQUIRE using dependency information from Project.toml.
#
# Call from the root of the package repository.
#
# Has some basic sanity checks, but **use at your own risk**, `REQUIRE`
# will be overwritten.
######################################################################

import Pkg
const PT = Pkg.Types

Pkg.activate(pwd())             # current directory as the project
ctx = PT.Context()
pkg = ctx.env.pkg
if pkg ≡ nothing
    @error "Not in a package, I won't generate REQUIRE."
    exit(1)
else
    @info "found package" pkg = pkg
end

deps = PT.get_deps(ctx)
non_std_deps = sort(collect(setdiff(keys(deps), values(ctx.stdlibs))))

open("REQUIRE", "w") do io
    for d in non_std_deps
        println(io, d)
        @info "listing $d"
    end
end

which I call manually to generate REQUIRE. Hope this will be fixed soon, I opened an issue


#7

Is there any update on AttoBot recently? Or and plans?


#8

One question about your script, @Tamas_Papp - it doesn’t seem to generate a julia x.y entry in the “REQUIRE” file. Is that intentional?


#9

Yes, it is, since it is not something the script can easily determine.


#10

Thanks, I suspected that might be the reason. “Project.toml” doesn’t allow to specify a Julia version range, right?


#11

It does, see the docs.

It is rather that the script was intended to be as a super-simple workaround, and only gives package names, not versions, at the moment.

If anyone has the time to extend it, they are welcome to do modify it.


#12

So it does, silly me. I think it’s because I’ve seen so many “Project.toml” files without Julia version spec around …