Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport allowing - in dataset names to 0.2 #49

Merged
merged 2 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]> 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