You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this we need to have a function that reads that config file into an internal representation and probably also a function that writes such a config file if it does not yet exists.
I'm looking at examples.py to get an idea now of what to do.
This is how it currently works:
#TODO: Insert your API token and User ID api_config.api_key['X-Auth-Token'] = "AUTH_TOKEN" api_config.api_key['X-Auth-UserId'] = "USER_UUID"
This then uses configuration.py from gs_api_client to create the authentication settings. Should this be changed to populate X-Auth-Token and X-Auth-UserId from the yaml file? Then only the project would have to be specified in the examples.py
Hey. Thanks for the work ❤️ and sorry for being a bit unresponsive! 😔
As a quick feed back on that branch:
First, can you drop the additions under .idea/ please? I have no objections adding editorconfig, IDE files, whatever if they make sense but if we do we should do it in a separate branch and PR and get the right people to review (like other PyCharm users 🙂 ).
Now to the nitty-gritty, the changes in configloader.py. Let's do it step by step.
Can you make load_config return a list of dicts whereas the keys are as follows?
This makes load_config always return a list (possible empty) of all projects that are defined by the user. It does not need to concern itself which one is default or "active" or so.
Since we're parsing YAML we need to add pyyaml as dependency (setup.py or dev-requirements.txt or both)
We should start by writing a small test to define an interface and the basic behavior. I took the freedom to do this here (2c62062) in your branch. You can run pytest to see the result. It currently fails. Maybe try to make it green without changing the test?
Ah, just saw another "formality". Can you make sure that you follow git commit message rules? See here for a nice writeup: https://cbea.ms/git-commit/#seven-rules
In your case, use imperative language and capitalization and punctuation. You might also want to configure your git config in a way that it shows your real name and email:
Activity
BoxG11 commentedon Apr 14, 2022
I'm looking at examples.py to get an idea now of what to do.
This is how it currently works:
#TODO: Insert your API token and User ID api_config.api_key['X-Auth-Token'] = "AUTH_TOKEN" api_config.api_key['X-Auth-UserId'] = "USER_UUID"This then uses configuration.py from gs_api_client to create the authentication settings. Should this be changed to populate X-Auth-Token and X-Auth-UserId from the yaml file? Then only the project would have to be specified in the examples.py
BoxG11 commentedon Apr 15, 2022
a first draft: https://github.com/gridscale/gridscale_api_client_python/commit/acb07f79e4526a67225c027a3b7a9c099dcd1b49.
Works on Mac but I can only check next week if the paths are formatted correctly on linux and windows. Happy easter.
bkircher commentedon Apr 22, 2022
Hey. Thanks for the work ❤️ and sorry for being a bit unresponsive! 😔
As a quick feed back on that branch:
First, can you drop the additions under .idea/ please? I have no objections adding editorconfig, IDE files, whatever if they make sense but if we do we should do it in a separate branch and PR and get the right people to review (like other PyCharm users 🙂 ).
Now to the nitty-gritty, the changes in configloader.py. Let's do it step by step.
This makes load_config always return a list (possible empty) of all projects that are defined by the user. It does not need to concern itself which one is default or "active" or so.
Since we're parsing YAML we need to add
pyyamlas dependency (setup.py or dev-requirements.txt or both)We should start by writing a small test to define an interface and the basic behavior. I took the freedom to do this here (2c62062) in your branch. You can run
pytestto see the result. It currently fails. Maybe try to make it green without changing the test?bkircher commentedon Apr 22, 2022
Ah, just saw another "formality". Can you make sure that you follow git commit message rules? See here for a nice writeup:
https://cbea.ms/git-commit/#seven-rules
In your case, use imperative language and capitalization and punctuation. You might also want to configure your git config in a way that it shows your real name and email: