Skip to content

Commit

Permalink
Merge pull request #102 from chengchingwen/master
Browse files Browse the repository at this point in the history
make env variable name consistent
  • Loading branch information
oxinabox authored Aug 23, 2019
2 parents cc1200f + e3758ae commit 936f315
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DataDeps"
uuid = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
authors = ["Lyndon White <oxinabox@ucc.asn.au>"]
version = "0.6.4"
version = "0.6.5"

[deps]
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Expand All @@ -10,7 +10,7 @@ SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[compat]
ExpectationStubs = "0.2.0"
HTTP = "0.7.0, 0.8"
HTTP = "0.8.5"
julia = "0.7, 1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/z10-for-end-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ DataDeps.jl tries to have very sensible defaults.
- Note that it remains your responsibility to understand and read any terms of the data use (this is remains true even if you don't turn on this bypass)
- This is provided for scripting (in particular CI) use
- If the `CI` environment variable is set to true, `DATADEPS_ALWAYS_ACCEPT` **must be set** to true or false. This is to prevent hanging in CI.
- `DATADEP_PROGRESS_UPDATE_PERIOD` -- how often (in seconds) to print the progress to the log for the download
- `DATADEPS_PROGRESS_UPDATE_PERIOD` -- how often (in seconds) to print the progress to the log for the download
- This is used by the default `fetch_method` and when implementing custom methods it is good to respect it.
- default: `5` (seconds) usually; `Inf` (i.e. no updates) if `DATADEPS_ALWAYS_ACCEPT` is set.
- `DATADEPS_LOAD_PATH` -- The list of paths to be prepended to the standard loadpath to save and load data from
Expand Down
11 changes: 8 additions & 3 deletions src/fetch_helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ This is used by the default `fetch_method` and is generally a good idea
to use it in any custom fetch method, if possible
"""
function progress_update_period()
envvar = get(ENV, "DATADEP_PROGRESS_UPDATE_PERIOD") do
if haskey(ENV, "DATADEP_ALWAYS_ACCEPT")
envvar = get(ENV, "DATADEPS_PROGRESS_UPDATE_PERIOD") do
if haskey(ENV, "DATADEPS_ALWAYS_ACCEPT")
# Running in a script, probably want minimal updates
"Inf"
else # default
"5" # seconds
if haskey(ENV, "DATADEP_PROGRESS_UPDATE_PERIOD")
@warn "\"DATADEP_PROGRESS_UPDATE_PERIOD\" is deprecated, use \"DATADEPS_PROGRESS_UPDATE_PERIOD\" instead."
get(ENV, "DATADEP_PROGRESS_UPDATE_PERIOD", "5")
else
"5" # seconds
end
end
end
parse(Float32, envvar)
Expand Down

2 comments on commit 936f315

@oxinabox
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

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

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.5 -m "<description of version>" 936f31532b3ae6745202fc82ed5941c10c5473e7
git push origin v0.6.5

Please sign in to comment.