Skip to content

Commit

Permalink
Merge pull request #403 from Drvi/td-http-ext
Browse files Browse the repository at this point in the history
Introduce `HTTPExt` package extension
  • Loading branch information
ViralBShah authored Nov 18, 2024
2 parents ef06d2d + 8d5c9fc commit 8840934
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name = "FileIO"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.16.5"
version = "1.16.6"

[deps]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"

[extensions]
HTTPExt = "HTTP"

[compat]
Pkg = "<0.0.1, 0.7, 1"
Requires = "1"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ PNGFiles = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883"

[compat]
Documenter = "1"
HTTP = "0.9"
HTTP = "0.9, 1"
13 changes: 13 additions & 0 deletions ext/HTTPExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module HTTPExt

if isdefined(Base, :get_extension)
using FileIO
using HTTP
else
using ..FileIO
using ..HTTP
end

FileIO.load(uri::HTTP.URI) = load(IOBuffer(HTTP.get(uri).body))

end # module
4 changes: 3 additions & 1 deletion src/FileIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ include("registry.jl")
"""
FileIO

@static if !isdefined(Base, :get_extension)
function __init__()
@require HTTP="cd3eb016-35fb-5094-929b-558a96fad6f3" begin
load(uri::HTTP.URI) = load(IOBuffer(HTTP.get(uri).body))
include("../ext/HTTPExt.jl")
end
end
end # @static

if VERSION >= v"1.4.2" # https://github.com/JuliaLang/julia/pull/35378
include("precompile.jl")
Expand Down

4 comments on commit 8840934

@Drvi
Copy link
Member

@Drvi Drvi commented on 8840934 Nov 19, 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.

Error while trying to register: Register Failed
@Drvi, it looks like you are not a publicly listed member/owner in the parent organization (JuliaIO).
If you are a member/owner, you will need to change your membership to public. See GitHub Help

@Drvi
Copy link
Member

@Drvi Drvi commented on 8840934 Nov 19, 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/119738

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 v1.16.6 -m "<description of version>" 8840934ad0e0faa06c15533e75875c280ba2fc73
git push origin v1.16.6

Please sign in to comment.