Skip to content

Commit

Permalink
Merge #29
Browse files Browse the repository at this point in the history
29: Deprecate all S3 functions r=morris25 a=morris25

Deprecates all the things in S3 and removes most of the tests in preparation for dropping the module.
Part of #12.

Co-authored-by: morris25 <sam.morrison@invenia.ca>
  • Loading branch information
bors[bot] and morris25 authored Sep 15, 2021
2 parents a08b92e + b0adda5 commit 59377a3
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 452 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AWSTools"
uuid = "83bcdc74-1232-581c-948a-f29122bf8259"
authors = ["Invenia Technical Computing"]
version = "1.10.0"
version = "1.10.1"

[deps]
AWSCore = "4f1ea46c-232b-54a6-9b17-cc2d0f3e6598"
Expand Down
8 changes: 0 additions & 8 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,3 @@ AWSTools.EC2.instance_metadata(::AbstractString)
AWSTools.EC2.instance_availability_zone()
AWSTools.EC2.instance_region()
```

### S3

#### Exported

```@docs
AWSTools.S3.upload
```
46 changes: 15 additions & 31 deletions src/S3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,29 @@ __precompile__()
module S3

using AWSCore
using AWSS3
using AWSS3: AWSS3
using Dates
using FilePathsBase
using Memento

import FilePathsBase: sync

export S3Path, sync, upload

const logger = getlogger(@__MODULE__)

# Register the module level logger at runtime so that folks can access the logger via
# `getlogger(MyModule)`. If this line is not included then the precompiled
# `MyModule.logger` won't be registered at runtime.
function __init__()
Memento.register(logger)
end

# Couple extra methods that should probably be included in AWSS3 at some point.
"""
upload(src::AbstractPath, dest::S3Path)
@deprecate S3Path(args...) AWSS3.S3Path(args...)
@deprecate upload(src::AbstractPath, dest::AWSS3.S3Path) Base.cp(src, dest)

Uploads a local file to the s3 path specified by `dest`.
"""
upload

const upload = Base.cp

# Note: naming copied from Go SDK:
# https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/s3-example-presigned-urls.html
function presign(
path::S3Path,
duration::Period=Hour(1);
config::AWSConfig=aws_config(),
@deprecate(
presign(path::AWSS3.S3Path, duration::Period=Hour(1); config::AWSConfig=aws_config()),
AWSS3.s3_sign_url(config, path.bucket, path.key, Dates.value(Second(duration))),
)
AWSS3.s3_sign_url(config, path.bucket, path.key, Dates.value(Second(duration)))
end

# TODO: Remove the sync methods below as they are now pirating.
@deprecate sync(src::AbstractString, dest::AbstractString; delete::Bool=false, config::AWSConfig=aws_config()) sync(Path(src), Path(dest); delete=delete)
@deprecate(
sync(
src::AbstractString,
dest::AbstractString;
delete::Bool=false,
config::AWSConfig=aws_config(),
),
FilePathsBase.sync(Path(src), Path(dest); delete=delete),
)

end # S3
Loading

4 comments on commit 59377a3

@morris25
Copy link
Contributor

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: Register Failed
@morris25, it looks like you are not a publicly listed member/owner in the parent organization (JuliaCloud).
If you are a member/owner, you will need to change your membership to public. See GitHub Help

@morris25
Copy link
Contributor

Choose a reason for hiding this comment

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

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

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 v1.10.1 -m "<description of version>" 59377a3fa3a9b6eab0123caf7120085fade9ee07
git push origin v1.10.1

Please sign in to comment.