Skip to content

Commit 2bcac29

Browse files
committed
Remove Kino.FS.file_spec
1 parent 9d74d14 commit 2bcac29

4 files changed

Lines changed: 0 additions & 150 deletions

File tree

lib/kino/fs.ex

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -47,56 +47,4 @@ defmodule Kino.FS do
4747
raise "failed to access file path, reason: #{inspect(reason)}"
4848
end
4949
end
50-
51-
@doc """
52-
Accesses notebook file with the given name and returns a specification
53-
of the file location.
54-
55-
This does not copy any files and moves the responsibility of reading
56-
the file to the caller. If you need to read a file directly, use
57-
`file_path/1`.
58-
"""
59-
@spec file_spec(String.t()) :: FSS.entry()
60-
def file_spec(name) do
61-
case Kino.Bridge.get_file_entry_spec(name) do
62-
{:ok, spec} ->
63-
file_spec_to_fss(spec)
64-
65-
{:error, :forbidden} ->
66-
raise ForbiddenError, name: name
67-
68-
{:error, message} ->
69-
raise message
70-
71-
{:request_error, reason} ->
72-
raise "failed to access file spec, reason: #{inspect(reason)}"
73-
end
74-
end
75-
76-
defp file_spec_to_fss(%{type: :local} = file_spec) do
77-
FSS.Local.from_path(file_spec.path)
78-
end
79-
80-
defp file_spec_to_fss(%{type: :url} = file_spec) do
81-
case FSS.HTTP.parse(file_spec.url) do
82-
{:ok, entry} -> entry
83-
{:error, error} -> raise error
84-
end
85-
end
86-
87-
defp file_spec_to_fss(%{type: :s3} = file_spec) do
88-
case FSS.S3.parse("s3:///" <> file_spec.key,
89-
config: [
90-
region: file_spec.region,
91-
endpoint: file_spec.bucket_url,
92-
access_key_id: file_spec.access_key_id,
93-
secret_access_key: file_spec.secret_access_key,
94-
# Token field is only available on Livebook v0.12 onwards
95-
token: Map.get(file_spec, :token)
96-
]
97-
) do
98-
{:ok, entry} -> entry
99-
{:error, error} -> raise error
100-
end
101-
end
10250
end

mix.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ defmodule Kino.MixProject do
3232
defp deps do
3333
[
3434
{:table, "~> 0.1.2"},
35-
{:fss, "~> 0.1.0"},
3635
{:nx, "~> 0.1", optional: true},
3736
{:plug, "~> 1.0", optional: true},
3837
{:ex_doc, "~> 0.28", only: :dev, runtime: false}

mix.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"complex": {:hex, :complex, "0.4.2", "923e5db0be13dbb3ea00cf8459d9f75f3afdd9ff5a82742ded21064330d28273", [:mix], [], "hexpm", "069a085ef820ce675a2619fd125b963ff4514af2102c7f7d7965128e5ec0a429"},
33
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
44
"ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
5-
"fss": {:hex, :fss, "0.1.0", "4118001edca820baba4b68c3295e92a7e9b80bbcd34abbfd9cf46f180e407595", [:mix], [], "hexpm", "c9659bf4a5438f0b2150629a3345b9370a8daca297554b8267a8708520e37ac7"},
65
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
76
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
87
"makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},

test/kino/fs_test.exs

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)