Skip to content

Commit

Permalink
Merge pull request #49 from JuliaComputing/mp/0.2.7
Browse files Browse the repository at this point in the history
Backport allowing `-` in dataset names to 0.2
  • Loading branch information
mortenpi authored Nov 1, 2022
2 parents 9d2132f + b711cb0 commit 09efe3d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- release-*
tags: '*'
pull_request:
jobs:
Expand All @@ -13,6 +14,8 @@ jobs:
strategy:
matrix:
version:
- '1.5'
- '1.7'
- '1'
- 'nightly'
os:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DataSets"
uuid = "c9661210-8a83-48f0-b833-72e62abce419"
authors = ["Chris Foster <chris42f@gmail.com> and contributors"]
version = "0.2.6"
version = "0.2.7"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
6 changes: 3 additions & 3 deletions src/DataSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ separated with forward slashes. Examples:
my_data
my_data_1
username/data
organization/project/data
organization-dataset_name/project/data
"""
function check_dataset_name(name::AbstractString)
# DataSet names disallow most punctuation for now, as it may be needed as
Expand All @@ -100,13 +100,13 @@ function check_dataset_name(name::AbstractString)
^
[[:alpha:]]
(?:
[[:alnum:]_] |
[-[:alnum:]_] |
/ (?=[[:alpha:]])
)*
$
"x
if !occursin(dataset_name_pattern, name)
error("DataSet name \"$name\" is invalid. DataSet names must start with a letter and can contain only letters, numbers, `_` or `/`.")
error("DataSet name \"$name\" is invalid. DataSet names must start with a letter and can contain only letters, numbers, `-`, `_` or `/`.")
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/driver_autoload.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testset "Automatic code loading for drivers" begin
empty!(DataSets.PROJECT)
pushfirst!(LOAD_PATH, abspath("drivers"))
Pkg.develop(path=joinpath(@__DIR__, "drivers", "DummyStorageBackends"))
ENV["JULIA_DATASETS_PATH"] = joinpath(@__DIR__, "DriverAutoloadData.toml")
DataSets.__init__()
@test haskey(DataSets._storage_drivers, "DummyTomlStorage")
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ end
@test DataSets.check_dataset_name("δεδομένα") === nothing
@test DataSets.check_dataset_name("a/b") === nothing
@test DataSets.check_dataset_name("a/b/c") === nothing
@test DataSets.check_dataset_name("a-b-c-") === nothing
# Invalid names
@test_throws ErrorException("DataSet name \"a?b\" is invalid. DataSet names must start with a letter and can contain only letters, numbers, `_` or `/`.") DataSets.check_dataset_name("a?b")
@test_throws ErrorException("DataSet name \"a?b\" is invalid. DataSet names must start with a letter and can contain only letters, numbers, `-`, `_` or `/`.") DataSets.check_dataset_name("a?b")
@test_throws ErrorException DataSets.check_dataset_name("1")
@test_throws ErrorException DataSets.check_dataset_name("a b")
@test_throws ErrorException DataSets.check_dataset_name("a.b")
Expand Down

2 comments on commit 09efe3d

@mortenpi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register branch=release-0.2

@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/71445

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.2.7 -m "<description of version>" 09efe3d7547414053cd33da739429f247d92aa56
git push origin v0.2.7

Please sign in to comment.