One option would be to use the @def macro that @ChrisRackauckas has mentioned here previously:
macro def(name, definition)
return quote
macro $(esc(name))()
esc($(Expr(:quote, definition)))
end
end
end
which you could use like this:
@def use_packages begin
using Pkg1, Pkg2, Pkg3
end
module Module01
@use_packages
end