From 783c2e18643f1dfd567bf752229b1c89752bc9e6 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Wed, 25 Mar 2026 14:26:01 +1300 Subject: [PATCH 1/9] fix typo in docstring --- src/MLJModelRegistryTools.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MLJModelRegistryTools.jl b/src/MLJModelRegistryTools.jl index ab5426c..d4b2a1e 100644 --- a/src/MLJModelRegistryTools.jl +++ b/src/MLJModelRegistryTools.jl @@ -22,7 +22,7 @@ Module providing tools for managing the MLJ Model Registry. To modify the regist - Point the `MLJModelRegistryTools` module to the location of the registry itself within your MLJModels.jl clone, using `setpath(path_to_registry)`, as in `setpath("MyPkgs/MLJModels.jl/src/registry")`. To check this worked, try - `MLJRegistryTools.get("MLJBase")`, to see the MLJBase.jl models. + `MLJModelRegistryTools.get("MLJBase")`, to see the MLJBase.jl models. - To add or update the metadata associated with a package, run [`update(pkg)`](@ref), as in `update("MLJTransforms"). Ensure that every model provided by the package appears as a From 97498b0b530abe9f939e6aea0c2997b29bbe3312 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Wed, 25 Mar 2026 14:27:15 +1300 Subject: [PATCH 2/9] fix another typo --- src/MLJModelRegistryTools.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MLJModelRegistryTools.jl b/src/MLJModelRegistryTools.jl index d4b2a1e..fe38504 100644 --- a/src/MLJModelRegistryTools.jl +++ b/src/MLJModelRegistryTools.jl @@ -25,8 +25,8 @@ Module providing tools for managing the MLJ Model Registry. To modify the regist `MLJModelRegistryTools.get("MLJBase")`, to see the MLJBase.jl models. - To add or update the metadata associated with a package, run [`update(pkg)`](@ref), as - in `update("MLJTransforms"). Ensure that every model provided by the package appears as a - key in the returned value. Omissions may indicate a bad `load_path`. + in `update("MLJTransforms")`. Ensure that every model provided by the package appears as + a key in the returned value. Omissions may indicate a bad `load_path`. - Assuming this is successful, update the metadata for *all* packages in the registry by running [`update()`](@ref). From be1ed7b70e936c56642bcbb315ca8a75e6b0d162 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 11:34:59 +1300 Subject: [PATCH 3/9] fix bug and add development tools --- src/GenericRegistry.jl | 8 ++++---- src/MLJModelRegistryTools.jl | 4 ++++ src/init.jl | 8 ++++++++ src/methods.jl | 23 +++++++++++++++++++---- test/methods.jl | 23 +++++++++++++++++------ 5 files changed, 52 insertions(+), 14 deletions(-) diff --git a/src/GenericRegistry.jl b/src/GenericRegistry.jl index f054ad4..4f9a61a 100644 --- a/src/GenericRegistry.jl +++ b/src/GenericRegistry.jl @@ -110,7 +110,7 @@ end # # METHODS """ - GenericRegistry.run([setup,] packages, program; environment=nothing) + GenericRegistry.run([setup,] packages, program; environment="") Assuming a package `environment` path is specified, do the following in a new Julia process: @@ -136,13 +136,13 @@ If `environment` is unspecified, then a fresh temporary environment is activated packages listed in `packages` are manually added between Steps 2 and 3 above. """ -function run(setup, pkgs, program; environment=nothing) +function run(setup, pkgs, program; environment="") pkgs isa Vector || (pkgs = [pkgs,]) imports = [:(import $(Symbol(pkg))) for pkg in pkgs] ex = quote using Pkg end - if isnothing(environment) + if isempty(environment) push!( ex.args, quote @@ -158,7 +158,7 @@ function run(setup, pkgs, program; environment=nothing) ) end push!(ex.args, quote $setup end) - if isnothing(environment) + if isempty(environment) additions = [:(Pkg.add($pkg)) for pkg in pkgs] push!( ex.args, diff --git a/src/MLJModelRegistryTools.jl b/src/MLJModelRegistryTools.jl index fe38504..502d962 100644 --- a/src/MLJModelRegistryTools.jl +++ b/src/MLJModelRegistryTools.jl @@ -1,6 +1,10 @@ """ MLJModelRegistryTools +!!! note + + Issues around packages in the MLJ model registry that use PythonCall necessitate `update` workarounds. See [https://github.com/JuliaAI/MLJModelRegistryTools.jl/issues/10](https://github.com/JuliaAI/MLJModelRegistryTools.jl/issues/10). + Module providing tools for managing the MLJ Model Registry. To modify the registry: - Make sure the MLJModelRegistryTools.jl `[compat]` entry for MLJModels is up to date. If diff --git a/src/init.jl b/src/init.jl index 6b25a1f..4e55713 100644 --- a/src/init.jl +++ b/src/init.jl @@ -1,3 +1,11 @@ function __init__() + dev = parse(Bool, Base.get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) + if !dev + @info "If you are developing MLJModelRegistryTools.jl, be sure to set "* + "`ENV[\"DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS\"] = \"true\"`. Otherwise, "* + "the methods from `src/remote_methods.jl` from the *registered* version "* + "of MLJModelRegistryTools.jl get applied during update, not the dev "* + "versions. " + end global REGISTRY_PATH=Ref("") end diff --git a/src/methods.jl b/src/methods.jl index ee78438..0d8e77e 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -14,6 +14,13 @@ err_invalid_packages(skip, env) = ArgumentError( const INFO_BE_PATIENT1 = "Be patient. This could take a minute or so ... " const INFO_BE_PATIENT10 = "Be patient. This could take ten minutes or so ..." +function warn_developing() + dev = ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] == "true" ? true : false + dev && @info "Registry tools working in development mode. Set "* + "`ENV[\"DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS\"] = \"false\"` "* + "to change this. " +end + # # HELPERS @@ -64,9 +71,13 @@ function metadata(pkg; registry="", check_traits=true) throw(err_missing_package(pkg, registry)) setup=() else + dev = ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] == "true" ? true : false setup = quote - # Pkg.develop(path=$ROOT) - Pkg.add("MLJModelRegistryTools") + if $dev + Pkg.develop(path=$ROOT) + else + Pkg.add("MLJModelRegistryTools") + end end end program = quote @@ -103,8 +114,10 @@ strings, and record this in the MLJ model registry (write it to Assumes `pkg` is already a dependency in the Julia environment defined at `/registry/` and uses the version of `pkg` consistent with the current environment manifest, after -MLJModelRegistryTools.jl has been `develop`ed into that environment (it is removed again after -the update). See documentation for details on the registration process. +MLJModelRegistryTools.jl has been `add`ed into that environment (it is removed again after +the update). (To `dev` the tools instead, you need to set +`ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] = "true"`.) See documentation for details on +the registration process. ```julia-repl julia> update("MLJDecisionTreeInterface") @@ -132,6 +145,7 @@ The metadata dictionary, keyed on models (more precisely, constructors, thereof) """ function update(pkg; debug=false, manifest=true, check_traits=true) + warn_developing() registry = manifest ? registry_path() : "" @info INFO_BE_PATIENT1 update(pkg, debug ? Loud() : Quiet(), registry, check_traits) @@ -186,6 +200,7 @@ function update( manifest=true, check_traits=true, ) + warn_developing() registry = manifest ? registry_path() : "" allpkgs = GenericRegistry.dependencies(registry_path()) if !isempty(registry) diff --git a/test/methods.jl b/test/methods.jl index 77c42b0..61a4620 100644 --- a/test/methods.jl +++ b/test/methods.jl @@ -76,12 +76,23 @@ setpath(registry) @test traits_given_model["Pipeline"][":name"] == "Pipeline" - packages = @test_logs( - (:info, ), - (:info, MLJModelRegistryTools.INFO_BE_PATIENT10), - MLJModelRegistryTools.update(), - ) - @test "MLJDecisionTreeInterface" in packages + dev = ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] == "true" ? true : false + if !dev + packages = @test_logs( + (:info, ), + (:info, MLJModelRegistryTools.INFO_BE_PATIENT10), + MLJModelRegistryTools.update(), + ) + @test "MLJDecisionTreeInterface" in packages + else + packages = @test_logs( + (:info, ), + (:info, ), + (:info, MLJModelRegistryTools.INFO_BE_PATIENT10), + MLJModelRegistryTools.update(), + ) + @test "MLJDecisionTreeInterface" in packages + end end @testset "get" begin From dfb4ee2a42ed0a662c9d85eaf5e02144c4f171c7 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 11:35:44 +1300 Subject: [PATCH 4/9] bump 0.1.3 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 03726c3..7f800ee 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJModelRegistryTools" uuid = "0a96183e-380b-4aa6-be10-c555140810f2" authors = ["Anthony D. Blaom "] -version = "0.1.2" +version = "0.1.3" [deps] Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" From add580f1a79f15e65fcb4cae7476c39e6a4b55ea Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 11:37:37 +1300 Subject: [PATCH 5/9] add dependabot --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c96f35a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + - package-ecosystem: "julia" + directories: # Location of Julia projects + - "/" + - "/docs" + schedule: + interval: "weekly" From 54dce46ce14c3ecd311ce62e4e6006f7c221ef87 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 11:45:35 +1300 Subject: [PATCH 6/9] fix typos --- src/GenericRegistry.jl | 2 +- src/methods.jl | 4 ++-- src/remote_methods.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GenericRegistry.jl b/src/GenericRegistry.jl index 4f9a61a..eff2aaa 100644 --- a/src/GenericRegistry.jl +++ b/src/GenericRegistry.jl @@ -25,7 +25,7 @@ standard library, `Pkg`. execute a Julia expression there; results are returned as `Future` objects, to allow asynchronous `run` calls. Useful for generating metadata about a package. -- [`GenericRegistry.close(future)`](@ref): Shut down the process intitiated by the `run` +- [`GenericRegistry.close(future)`](@ref): Shut down the process initiated by the `run` call that returned `future` (after calling `fetch(future)` to get the result of evaluation). diff --git a/src/methods.jl b/src/methods.jl index 0d8e77e..52b8e3f 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -32,7 +32,7 @@ function clean!(dic, pkg) return dic end -# develop MLJModelRegistryTools into the specifified `registry` project: +# develop MLJModelRegistryTools into the specified `registry` project: function setup(registry) ex = quote # Pkg.develop(path=$ROOT) @@ -43,7 +43,7 @@ function setup(registry) GenericRegistry.close(future) end -# remove MLJModelRegistryTools from the specifified `registry` project: +# remove MLJModelRegistryTools from the specified `registry` project: function cleanup(registry) ex = quote Pkg.rm("MLJModelRegistryTools") diff --git a/src/remote_methods.jl b/src/remote_methods.jl index ea4f949..222cf60 100644 --- a/src/remote_methods.jl +++ b/src/remote_methods.jl @@ -1,4 +1,4 @@ -# Remote methods are methods called on remote processes for the purpose of when extacting +# Remote methods are methods called on remote processes for the purpose of when extracting # model metadata for a package From fb666d7d836b3cab4789f138d7c78f392993eaf9 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 11:53:44 +1300 Subject: [PATCH 7/9] fix KeyError --- src/methods.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/methods.jl b/src/methods.jl index 52b8e3f..0e9f624 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -15,7 +15,7 @@ const INFO_BE_PATIENT1 = "Be patient. This could take a minute or so ... " const INFO_BE_PATIENT10 = "Be patient. This could take ten minutes or so ..." function warn_developing() - dev = ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] == "true" ? true : false + dev = parse(get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) dev && @info "Registry tools working in development mode. Set "* "`ENV[\"DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS\"] = \"false\"` "* "to change this. " @@ -71,7 +71,7 @@ function metadata(pkg; registry="", check_traits=true) throw(err_missing_package(pkg, registry)) setup=() else - dev = ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] == "true" ? true : false + dev = parse(Bool, get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) setup = quote if $dev Pkg.develop(path=$ROOT) From 7f7262643757805a9b3831ace64f6dc66fd046c5 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 13:15:24 +1300 Subject: [PATCH 8/9] fix another KeyError, this time in test/ --- test/methods.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/methods.jl b/test/methods.jl index 61a4620..008e48a 100644 --- a/test/methods.jl +++ b/test/methods.jl @@ -76,7 +76,7 @@ setpath(registry) @test traits_given_model["Pipeline"][":name"] == "Pipeline" - dev = ENV["DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS"] == "true" ? true : false + dev = parse(Bool, get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) if !dev packages = @test_logs( (:info, ), From aadba7c0ef432388c5e4eca4fc3ab4760f4a885f Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Mar 2026 14:44:12 +1300 Subject: [PATCH 9/9] fix some syntax errors --- src/methods.jl | 4 ++-- test/methods.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/methods.jl b/src/methods.jl index 0e9f624..6846f19 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -15,7 +15,7 @@ const INFO_BE_PATIENT1 = "Be patient. This could take a minute or so ... " const INFO_BE_PATIENT10 = "Be patient. This could take ten minutes or so ..." function warn_developing() - dev = parse(get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) + dev = parse(Bool, Base.get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) dev && @info "Registry tools working in development mode. Set "* "`ENV[\"DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS\"] = \"false\"` "* "to change this. " @@ -71,7 +71,7 @@ function metadata(pkg; registry="", check_traits=true) throw(err_missing_package(pkg, registry)) setup=() else - dev = parse(Bool, get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) + dev = parse(Bool, Base.get(ENV, "DEVELOPING_MLJ_MODEL_REGISTRY_TOOLS", "false")) setup = quote if $dev Pkg.develop(path=$ROOT) diff --git a/test/methods.jl b/test/methods.jl index 008e48a..3368866 100644 --- a/test/methods.jl +++ b/test/methods.jl @@ -32,7 +32,7 @@ project = joinpath(registry, "Project.toml") manifest = joinpath(registry, "Manifest.toml") open(project, "w") do file write(file, project_string) -end +end; @testset "metadata" begin @suppress begin