-
Notifications
You must be signed in to change notification settings - Fork 27
Environment vars in config.yaml
file
#67
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
Conversation
``` | ||
|
||
Done! You can use diffengine as usual and keep your credentials safe. | ||
|
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.
Feel free to edit this at will
config_file = os.path.join(home, "config.yaml") | ||
if os.path.isfile(config_file): | ||
config = yaml.load(open(config_file), Loader=yaml.FullLoader) | ||
config = EnvYAML(config_file) |
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.
Here is the actual change.
All the others one are automatic whitespaces replacements that my IDEs does automatically
Looks good! So it looks like you would rather submit discrete pull requests for new functionality instead of working with the [threads] branch that merged in your entire master? That is fine with me. I just thought it could be easier to shape what you have on master since you have added quite a few new things. |
Yes, I really prefer this approach so I can make the proper tests and refactor the code properly! |
I've also created an issue to see if it's possible to define a common formatter for the entire project. So when I pull changes they really only focus on the what actually changed and not about formatting diffs (like happened here with some whitespaces) |
After I merged this I noticed that the test is failing, and was wondering if you are seeing the same?
|
I'll see if I can fix this, which will help me understand the changes better! |
Some small changes to get this test to work. Unfortunately diffenigne.config is a global in the diffengine module, and changing it doesn't play nicely with the tests. I added a return value for diffengine.load_config that makes this easier. refs #67
@nahuelhds make sure you merge the latest from master for this change to get the tests working again. |
Hmm, the test works for me locally, but not in Travis. Maybe Travis already uses |
I marked the test for skipping when running under Travis. |
Oh you use Travis. Wouldn't be nice to connect Travis to your master repo so we could wait for the CI to pass and avoid this kind of issue, don't you think? Regard the issue itself, I'm seeing now that fails for me locally but don't worry. I'll try to make it work by using another env file name so it doens't mess with the original one from Travis |
Yes, Travis should only run on the master branch. I just pushed a change for that to Master. I'll be more careful about verifying new tests work before merging in the future! |
Target: to keep my credentails and tokens secretly so I can use them safely in services like Heroku, Vercel or any other.
Usage
The configuration file
In the
config.yaml
fileDefining the env vars
Every service like Heroku, Vercel, etc, offers a way to define environment vars for the project. Just define them there.
Othewsie, you can define them locally (or remotely too if you have your own server), by creating a
.env
file, this way:Of course, this file has to be ignored in the version control.