Skip to content
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

Deteremine how to implement configuration files #13

Open
Sylk opened this issue Mar 31, 2019 · 2 comments
Open

Deteremine how to implement configuration files #13

Sylk opened this issue Mar 31, 2019 · 2 comments
Assignees

Comments

@Sylk
Copy link
Owner

Sylk commented Mar 31, 2019

Currently there are two implementations for configurations for the files currently existing.
The first being the .env, and another type introduced by @Gremyo in the file private_keys.py.

While my preference leans to the .env route, I've also found another route that was introduced by this project. https://github.com/nluedtke/brochat-bot

There needs to be talk on what the proper implementation should be.

@Sylk Sylk assigned Sylk and Gremyo Mar 31, 2019
@Sylk Sylk changed the title Deteremine the proper route for configuration Deteremine how to implement configuration files Mar 31, 2019
@Gremyo
Copy link
Collaborator

Gremyo commented Apr 1, 2019

The advantage of the module approach is that it keeps everything within python and requires no set-up script. The user simply takes the example_private_key.py file, replaces the place holder with their key, and removes the example_ part of the name. This means not having to mess with any environment variables.

@isConic
Copy link
Contributor

isConic commented Apr 1, 2019

Environment Variables

I like environment variables from a devops standpoint.
It's easier to fine tune and set env-variables per instance when spawning them, than it is to automate the editing of a config file, yet alone a python script.

It is:

  • Hard to accidentally commit an ENV variable.
  • Easy to provide two liner copy-paste code in the setup portion of the readme that adds to your bashrc.
  • something that ties you to using linux.

Use of config.py

The idea of importing namespaces sounds interesting:

import bot_config as configs

bot_token = configs.bot_token

Within a config file you can even implement checks for whether or not you've set it. So as soon as the import happens, you can raise errors about it not being there. It's not a standard way of doing it.

Agnostic to OS

yaml

Seems to be the go-to for config files in most of the projects I've worked on in python.
Agnostic to OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants