Skip to content

Commit 352e580

Browse files
authored
Merge branch 'main' into dependabot/github_actions/codecov/codecov-action-5
2 parents 5b46e1c + 49fafb1 commit 352e580

File tree

7 files changed

+81
-10
lines changed

7 files changed

+81
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## Unreleased
6+
7+
### Fixed
8+
9+
* The `JuliaHub.update_dataset` function now correctly accepts the `license=(:fulltext, ...)` argument. ([#74])
10+
511
## Version [v0.1.11] - 2024-06-27
612

713
### Added
@@ -134,3 +140,4 @@ Initial package release.
134140
[#52]: https://github.com/JuliaComputing/JuliaHub.jl/issues/52
135141
[#53]: https://github.com/JuliaComputing/JuliaHub.jl/issues/53
136142
[#58]: https://github.com/JuliaComputing/JuliaHub.jl/issues/58
143+
[#74]: https://github.com/JuliaComputing/JuliaHub.jl/issues/74

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JuliaHub"
22
uuid = "bc7fa6ce-b75e-4d60-89ad-56c957190b6e"
33
authors = ["JuliaHub Inc."]
4-
version = "0.1.11"
4+
version = "0.1.12-DEV"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/authentication.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ The zero- and one-argument methods will attempt to read the token from the curre
173173
If a valid authentication token does not exist in the Julia depot, a new token is acquired via an
174174
interactive browser based prompt. By default, it attemps to connect to the currently configured Julia
175175
package server URL (configured e.g. via the `JULIA_PKG_SERVER` environment variable), but this
176-
can be overridden by passing the `server` argument.
176+
can be overridden by passing the `server` argument. `server` is just the URL of your JuliaHub instance,
177+
so if you've logged on to the public JuliaHub server, this is `"juliahub.com"`.
177178
178179
The two-argument method can be used when you do not want to read the token from the `auth.toml`
179180
file (e.g. when using a long-term token via an environment variable). In this case, you also have

src/datasets.jl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,15 @@ const _DOCS_datasets_metadata_fields = """
465465
* `description`: description of the dataset (a string)
466466
* `tags`: an iterable of strings of all the tags of the dataset
467467
* `visibility`: a string with possible values `public` or `private`
468-
* `license`: a valid SPDX license identifier, or a tuple `(:fulltext, license_text)`, where
469-
`license_text` is the full text string of a custom license
468+
* `license`: a valid SPDX license identifier (as a string or in a
469+
`(:spdx, licence_identifier)` tuple), or a tuple `(:fulltext, license_text)`,
470+
where `license_text` is the full text string of a custom license
470471
* `groups`: an iterable of valid group names
472+
473+
!!! compat "JuliaHub.jl v0.1.12"
474+
475+
The `license = (:fulltext, ...)` form requires v0.1.12, and `license = (:text, ...)`
476+
is deprecated since that version.
471477
"""
472478

473479
"""
@@ -983,7 +989,14 @@ function update_dataset end
983989
cmd, license_value = license
984990
params["license"] = if cmd == :spdx
985991
Dict("spdx_id" => license_value)
986-
elseif cmd == :text
992+
elseif cmd in (:fulltext, :text)
993+
if cmd == :text
994+
Base.depwarn(
995+
"Passing license=(:text, ...) is deprecated, use license=(:fulltext, ...) instead.",
996+
:update_dataset;
997+
force=true,
998+
)
999+
end
9871000
Dict("text" => license_value)
9881001
else
9891002
throw(ArgumentError("Invalid license argument: $(cmd) ∉ [:spdx, :text]"))

src/jobs/logging.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function haslast end
214214
"""
215215
JuliaHub.job_logs_buffered(
216216
[f::Base.Callable], job::Union{Job,AbstractString};
217-
streaming::Bool=true, [offset::Integer],
217+
stream::Bool=true, [offset::Integer],
218218
[auth::Authentication]
219219
) -> AbstractJobLogsBuffer
220220
@@ -228,15 +228,15 @@ The function accepts the following arguments:
228228
The first argument is the buffer object itself, and the second argument will be passed a _read-only
229229
view_ of all the logs that have been loaded into the buffer, including the new ones.
230230
* `job :: Union{Job,AbstractString}`: either the job name or a [`Job`](@ref) object.
231-
* `streaming :: Bool`: if set to `true`, the buffer object The streaming can be stopped with
232-
[`interrupt!`](@ref).
231+
* `stream :: Bool`: if set to `true`, the buffer object will automatically pull new logs in a
232+
an asynchronous background task. The streaming can be stopped with [`interrupt!`](@ref).
233233
* `offset :: Integer`: optional non-negative value to specify the starting point of the buffer
234234
235235
# Interface of the returned object
236236
237237
Returns an instance of the abstract [`AbstractJobLogsBuffer`](@ref) type.
238238
These objects contain log messages (of type [`JobLogMessage`](@ref)), but not all the log messages
239-
are immediately available. Instead, at any given time the buffer represents a continous section of
239+
are immediately available. Instead, at any given time the buffer represents a continuous section of
240240
logs that can be extended in either direction.
241241
242242
The following functions can be used to interact with log buffers: [`job_logs_newer!`](@ref),

src/jobsubmission.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,12 @@ function submit_job(
12461246
else
12471247
c.env
12481248
end
1249-
args = merge(get(app, :args, Dict()), args)
1249+
args = merge(
1250+
# Note: we need to ::Dict type assertion here to avoid JET complaining with:
1251+
# no matching method found `convert(::Type{Dict}, ::NamedTuple)`: convert(JuliaHub.Dict, _26::NamedTuple)
1252+
get(app, :args, Dict())::Dict,
1253+
args,
1254+
)
12501255

12511256
projectid = isnothing(c.project) ? nothing : string(c.project)
12521257

test/datasets.jl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,24 @@ end
237237
@test_throws TypeError JuliaHub.update_dataset(
238238
"example-dataset"; description=42
239239
)
240+
# Different options for `license` keyword
241+
@test JuliaHub.update_dataset("example-dataset"; license="MIT") isa JuliaHub.Dataset
242+
@test JuliaHub.update_dataset("example-dataset"; license=(:spdx, "MIT")) isa
243+
JuliaHub.Dataset
244+
@test JuliaHub.update_dataset("example-dataset"; license=(:fulltext, "...")) isa
245+
JuliaHub.Dataset
246+
# This should log a deprecation warning
247+
@test @test_logs (
248+
:warn,
249+
"Passing license=(:text, ...) is deprecated, use license=(:fulltext, ...) instead.",
250+
) JuliaHub.update_dataset(
251+
"example-dataset"; license=(:text, "...")
252+
) isa JuliaHub.Dataset
253+
@test_throws TypeError JuliaHub.update_dataset("example-dataset"; license=1234)
254+
@test_throws ArgumentError JuliaHub.update_dataset("example-dataset"; license=(:foo, ""))
255+
@test_throws TypeError JuliaHub.update_dataset(
256+
"example-dataset"; license=(:fulltext, 1234)
257+
)
240258
end
241259
end
242260

@@ -293,6 +311,33 @@ end
293311

294312
# @test JuliaHub.upload_dataset(
295313
# "existing-dataset", @__FILE__; update=true) isa JuliaHub.Dataset
314+
315+
# Different options for `license` keyword
316+
@test JuliaHub.upload_dataset(
317+
"example-dataset-license", @__FILE__; create=true, license="MIT"
318+
) isa JuliaHub.Dataset
319+
@test JuliaHub.upload_dataset(
320+
"example-dataset-license", @__FILE__; replace=true, license=(:spdx, "MIT")
321+
) isa JuliaHub.Dataset
322+
@test JuliaHub.upload_dataset(
323+
"example-dataset-license", @__FILE__; replace=true, license=(:fulltext, "...")
324+
) isa JuliaHub.Dataset
325+
# This should log a deprecation warning
326+
@test @test_logs (
327+
:warn,
328+
"Passing license=(:text, ...) is deprecated, use license=(:fulltext, ...) instead.",
329+
) JuliaHub.upload_dataset(
330+
"example-dataset-license", @__FILE__; replace=true, license=(:text, "...")
331+
) isa JuliaHub.Dataset
332+
@test_throws TypeError JuliaHub.upload_dataset(
333+
"example-dataset-license", @__FILE__; replace=true, license=1234
334+
)
335+
@test_throws ArgumentError JuliaHub.upload_dataset(
336+
"example-dataset-license", @__FILE__; replace=true, license=(:foo, "")
337+
)
338+
@test_throws TypeError JuliaHub.upload_dataset(
339+
"example-dataset-license", @__FILE__; replace=true, license=(:fulltext, 1234)
340+
)
296341
end
297342
empty!(MOCK_JULIAHUB_STATE)
298343
end

0 commit comments

Comments
 (0)