Skip to content

Commit

Permalink
Compat fix for ConstructionBase 1.5.7 (#123)
Browse files Browse the repository at this point in the history
* Compat fix for ConstructionBase 1.5.7

* Set project version to 0.5.20

* Use Julia 1.6 Project.toml ordering

* Require ConstructionBase 1.5.7
  • Loading branch information
omus authored Aug 28, 2024
1 parent 3d9c19e commit 69e11c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
16 changes: 8 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Legolas"
uuid = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd"
authors = ["Beacon Biosignals, Inc."]
version = "0.5.19"
version = "0.5.20"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand All @@ -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"
11 changes: 4 additions & 7 deletions ext/LegolasConstructionBaseExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +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`:
# https://github.com/JuliaObjects/ConstructionBase.jl/blob/cd24e541fd90ab54d2ee12ddd6ccd229be9a5f1e/src/ConstructionBase.jl#L211-L218
# 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}
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...)
ConstructionBase.check_patch_fields_exist(r, patch)
return ConstructionBase.setfields_object(r, patch)
end
end

Expand Down

2 comments on commit 69e11c7

@omus
Copy link
Member Author

@omus omus commented on 69e11c7 Aug 28, 2024

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/114058

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 v0.5.20 -m "<description of version>" 69e11c7978bbb90bd23e9f0a12cf8f8fe6715b33
git push origin v0.5.20

Please sign in to comment.