Skip to content

Commit

Permalink
Merge #450
Browse files Browse the repository at this point in the history
450: 🤖 Automatically format the source code files r=DilumAluthge a=github-actions[bot]

This pull request formats the source code files using the JuliaFormatter package.

Co-authored-by: bors[bot] <bors[bot]@users.noreply.github.com>
  • Loading branch information
bors[bot] and bors[bot] authored Mar 14, 2023
2 parents a477046 + 857f7e8 commit 76a911a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions src/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,20 @@ function clone_all_registries(f::Function, registry_list::Vector{Pkg.RegistrySpe
@mock git_clone(registry.url, local_registry_path)
end

registries = RegistryInstances.reachable_registries(; depots = tmp_dir)
registries = RegistryInstances.reachable_registries(; depots=tmp_dir)

f(registries)

@mock rm(tmp_dir; force=true, recursive=true)

nothing
return nothing
end

function get_latest_version!(deps::Set{DepInfo}, registries::Vector{RegistryInstances.RegistryInstance}; options::Options)
function get_latest_version!(
deps::Set{DepInfo},
registries::Vector{RegistryInstances.RegistryInstance};
options::Options,
)
for registry_instance in registries
packages = registry_instance.pkgs

Expand All @@ -86,7 +90,10 @@ function get_latest_version!(deps::Set{DepInfo}, registries::Vector{RegistryInst

if uuid in keys(packages)
pkginfo = RegistryInstances.registry_info(packages[uuid])
versions = [k for (k, v) in pkginfo.version_info if options.include_yanked || !v.yanked]
versions = [
k for
(k, v) in pkginfo.version_info if options.include_yanked || !v.yanked
]

max_version = maximum(versions)
dep.latest_version = _max(dep.latest_version, max_version)
Expand All @@ -96,7 +103,7 @@ function get_latest_version!(deps::Set{DepInfo}, registries::Vector{RegistryInst
end

function get_existing_registries!(deps::Set{DepInfo}, depot::String; options::Options)
registries = RegistryInstances.reachable_registries(; depots = depot)
registries = RegistryInstances.reachable_registries(; depots=depot)
get_latest_version!(deps, registries; options)

return deps
Expand Down
4 changes: 2 additions & 2 deletions test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
end

@testset "clone_all_registries" begin
registry_1_url, registry_1_name = "https://github.com/JuliaRegistries/General", "General"
registry_1_url, registry_1_name = "https://github.com/JuliaRegistries/General",
"General"
registry_2_url, registry_2_name = "https://github.com/JuliaRegistries/Test", "Test"

# Use temporary DEPOT_PATH
Expand All @@ -45,7 +46,6 @@ end
Pkg.RegistrySpec(; name=registry_1_name, url=registry_1_url),
Pkg.RegistrySpec(; name=registry_2_name, url=registry_2_url),
]) do registries

@test length(registries) == 2
@test contains(registry_1_name, registries[1].name)
@test contains(registry_2_name, registries[2].name)
Expand Down

2 comments on commit 76a911a

@DilumAluthge
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/79596

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.7.0 -m "<description of version>" 76a911ac27902286f5fb06afa5e8e6da1a127be1
git push origin v3.7.0

Please sign in to comment.