-
Notifications
You must be signed in to change notification settings - Fork 8
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
adds scoped values credential to support multiple endpoints. #58
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the suggested improvement @ghyatzo , you can find review comments attached.
I'll add some examples of this new usage in the readme later |
src/CDSAPI.jl
Outdated
if VERSION >= v"1.11" | ||
using Base.ScopedValues | ||
elseif VERSION >= v"1.8" | ||
import Pkg | ||
Pkg.activate(".") | ||
Pkg.add("ScopedValues") | ||
using ScopedValues | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to run these commands in the source code to modify the Project.toml of the package. There is no problem in adding ScopedValues.jl as a dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so then just remove the Pkg.add("ScopedValues")
and add it normally
Yes. You can run these commands locally in the package folder. They will
modify the Project.toml
Em qui., 16 de jan. de 2025, 12:06, cschen ***@***.***>
escreveu:
… ***@***.**** commented on this pull request.
------------------------------
In src/CDSAPI.jl
<#58 (comment)>
:
> +if VERSION >= v"1.11"
+ using Base.ScopedValues
+elseif VERSION >= v"1.8"
+ import Pkg
+ Pkg.activate(".")
+ Pkg.add("ScopedValues")
+ using ScopedValues
+end
Ok, so then just remove the Pkg.add("ScopedValues")?
—
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZQW3KKMMII4VVL7SALNBL2K7DGVAVCNFSM6AAAAABVG4LWPSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNJWGQ2DCOBYGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Co-authored-by: Júlio Hoffimann <[email protected]>
Co-authored-by: Júlio Hoffimann <[email protected]>
Co-authored-by: Júlio Hoffimann <[email protected]>
and various renames
Co-authored-by: Júlio Hoffimann <[email protected]>
OK, I've rebased onto master to have the other PRs. |
tests pass locally |
Hello,
I had wrote my script for downloading CDS data, before checking if it existed already.
Funnily enough our implementations are eerily similar.
There are some slight differences that I would like to propose as improvements/additions to this package so we can have a single point.
This is the first of 3 pull requests, one for each proposal so they can be addressed independently.
Ok with that out of the way:
I would like to propose the use of scoped values for the API credentials. As well as a bit better credential retrieval mechanism that also checks for environmental variables.
This allows to use different credentials for each request, for example: