From 8428016cacc36007656d3a5c1ada57e87a2a2daa Mon Sep 17 00:00:00 2001 From: Fernando Chorney Date: Mon, 14 Dec 2020 12:39:20 -0600 Subject: [PATCH 1/3] Support FilePathsBase 0.9 --- Project.toml | 6 +++--- test/S3.jl | 2 +- test/runtests.jl | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index a0acdcc..e6b4e44 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AWSTools" uuid = "83bcdc74-1232-581c-948a-f29122bf8259" authors = ["Invenia Technical Computing"] -version = "1.7.4" +version = "1.8.0" [deps] AWSCore = "4f1ea46c-232b-54a6-9b17-cc2d0f3e6598" @@ -20,9 +20,9 @@ XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5" [compat] AWSCore = "0.5, 0.6" -AWSS3 = "0.6" +AWSS3 = "0.6, 0.7" EzXML = "0.7.3, 0.8, 0.9, 1" -FilePathsBase = "0.6, 0.7, 0.8" +FilePathsBase = "0.6, 0.7, 0.8, 0.9" HTTP = "0.8.4" MbedTLS = "0.6, 0.7, 1" Memento = "0.12.1, 0.13, 1" diff --git a/test/S3.jl b/test/S3.jl index df863ee..31afce0 100644 --- a/test/S3.jl +++ b/test/S3.jl @@ -283,7 +283,7 @@ end end @testset "Download via presign" begin - src = Path("$s3_prefix/presign/file") + src = S3Path("$s3_prefix/presign/file") content = "presigned content" s3_put(src.bucket, src.key, content) diff --git a/test/runtests.jl b/test/runtests.jl index 23576e3..f66290d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,6 +2,8 @@ using AWSCore: AWSCredentials, AWSException, aws_config using AWSTools using Dates using Documenter +using FilePathsBase +using FilePathsBase: join using HTTP using Memento using Mocking From cfaa6ffa75b60fb510ff407389c0a746598694cb Mon Sep 17 00:00:00 2001 From: Fernando Chorney Date: Wed, 16 Dec 2020 16:11:49 -0600 Subject: [PATCH 2/3] Make sure s3 paths are `S3Path` --- test/S3.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/S3.jl b/test/S3.jl index 31afce0..6021252 100644 --- a/test/S3.jl +++ b/test/S3.jl @@ -224,7 +224,7 @@ end try @testset "Upload to S3" begin - dest = Path("$s3_prefix/folder3/testfile") + dest = S3Path("$s3_prefix/folder3/testfile") try mktemp() do src, stream @@ -247,7 +247,7 @@ end end @testset "Download from S3" begin - src = Path("$s3_prefix/folder4/testfile") + src = S3Path("$s3_prefix/folder4/testfile") try s3_put(src.bucket, src.key, "Remote content") @@ -312,8 +312,8 @@ end @testset "Sync S3 directories" begin bucket, key_prefix = bucket_and_key(s3_prefix) - src_dir = Path("$s3_prefix/folder1/") - dest_dir = Path("$s3_prefix/folder2/") + src_dir = S3Path("$s3_prefix/folder1/") + dest_dir = S3Path("$s3_prefix/folder2/") # Directories should be empty, but just in case # delete any pre-existing objects in the s3 bucket directories @@ -374,12 +374,12 @@ end # Test readdir only lists files and "dirs" within this S3 "dir" @test readdir(dest_dir) == ["file1", "file2", "folder/"] - @test readdir(Path("$s3_prefix/")) == [ + @test readdir(S3Path("$s3_prefix/")) == [ "folder1/", "folder2/", "presign/" ] # Not including the ending `/` means this refers to an object and # not a directory prefix in S3 - @test_throws ArgumentError readdir(Path(s3_prefix)) + @test_throws ArgumentError readdir(S3Path(s3_prefix)) @testset "Sync modified dest file" begin # Modify a file in dest @@ -441,7 +441,7 @@ end file = "s3://" * join([obj["Bucket"], obj["Key"]], '/') @test startswith(file, "s3://") - @test_throws ArgumentError sync(Path(file), dest_dir) + @test_throws ArgumentError sync(S3Path(file), dest_dir) end rm(src_files[1]) @@ -502,14 +502,14 @@ end finally # Clean up any files left in the test directory - rm(Path("$s3_prefix/"); recursive=true) + rm(S3Path("$s3_prefix/"); recursive=true) # Delete bucket if it was explicitly created if TEST_BUCKET_AND_PREFIX === nothing s3_bucket_dir = replace(s3_prefix, r"^(s3://[^/]+).*$" => s"\1") bucket, key = bucket_and_key(s3_bucket_dir) @info "Deleting S3 bucket $bucket" - rm(Path("s3://$bucket/"); recursive=true) + rm(S3Path("s3://$bucket/"); recursive=true) s3_delete_bucket(bucket) end end From e6232b631e158b1046f1ed8e303bf0f313671f58 Mon Sep 17 00:00:00 2001 From: Fernando Chorney Date: Thu, 17 Dec 2020 10:37:31 -0600 Subject: [PATCH 3/3] Don't need AWSS3 0.7 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e6b4e44..b0f4084 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5" [compat] AWSCore = "0.5, 0.6" -AWSS3 = "0.6, 0.7" +AWSS3 = "0.6" EzXML = "0.7.3, 0.8, 0.9, 1" FilePathsBase = "0.6, 0.7, 0.8, 0.9" HTTP = "0.8.4"