Skip to content

Commit

Permalink
Merge branch 'main' into cv/constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
omus authored Aug 29, 2024
2 parents 8c7523d + 69e11c7 commit 48e8e85
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @jrevels @omus
* @jrevels @omus @kleinschmidt
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@ ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"

[extensions]
LegolasConstructionBaseExt = "ConstructionBase"

[compat]
Accessors = "0.1"
Aqua = "0.8"
Arrow = "2.7"
ArrowTypes = "2.3"
Compat = "3.34, 4"
ConstructionBase = "1.5"
ConstructionBase = "1.5.7"
DataFrames = "1"
Tables = "1.4"
Test = "1"
UUIDs = "1"
julia = "1.6"

[extensions]
LegolasConstructionBaseExt = "ConstructionBase"

[extras]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand All @@ -39,3 +36,6 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[targets]
test = ["Accessors", "Aqua", "Compat", "DataFrames", "Test", "UUIDs"]

[weakdeps]
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
18 changes: 4 additions & 14 deletions ext/LegolasConstructionBaseExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,11 @@ using Legolas: AbstractRecord
if VERSION < v"1.7"
ConstructionBase.getproperties(r::AbstractRecord) = NamedTuple(r)

# This is largely copy-paste from `ConstructionBase.setproperties_object` (v1.5.7):
# https://github.com/JuliaObjects/ConstructionBase.jl/blob/71fb5a5198f41f3ef29a53c01940cf7cf6b233eb/src/ConstructionBase.jl#L205-L209
function ConstructionBase.setproperties(r::R, patch::NamedTuple) where {R<:AbstractRecord}
if isdefined(ConstructionBase, :check_patch_properties_exist)
# This is largely copy-paste from `ConstructionBase.setproperties_object`:
# https://github.com/JuliaObjects/ConstructionBase.jl/blob/cd24e541fd90ab54d2ee12ddd6ccd229be9a5f1e/src/ConstructionBase.jl#L211-L218
nt = getproperties(r)
nt_new = merge(nt, patch)
ConstructionBase.check_patch_properties_exist(nt_new, nt, r, patch)
args = Tuple(nt_new) # old Julia inference prefers if we wrap in `Tuple`
return constructorof(R)(args...)
else
# As of ConstructionBase 1.5.7 the internals of `ConstructionBase.setproperties_object` have changed:
# https://github.com/JuliaObjects/ConstructionBase.jl/blob/71fb5a5198f41f3ef29a53c01940cf7cf6b233eb/src/ConstructionBase.jl#L205-L209
ConstructionBase.check_patch_fields_exist(r, patch)
return ConstructionBase.setfields_object(r, patch)
end
ConstructionBase.check_patch_fields_exist(r, patch)
return ConstructionBase.setfields_object(r, patch)
end
end

Expand Down

0 comments on commit 48e8e85

Please sign in to comment.