We want everybody to be able to contribute to our projects whatever your level or programming experiance is. Don't hesitate to ask for help on the Code Society's Discord server whatever the problem is.
You can contribute to this project in the follwing ways
- Open an issue follwing the bug template.
- Communicate directly with us on the Code Society's Discord server.
- Fix the bug directly. To do so, follow add a changes.
- Open an issue follwing the feature request template.
- Communicate directly with us on the Code Society's Discord server.
Installing Grace is fairly simple. You can do it in three short step.
-
The first step is pretty simple, install Python. You need to install Python 3.9 or higher.
-
In the
gracedirectory project, open a terminal (Linus/MacOS) or cmd (Windows) and executepip install -e .(recommend for development) orpip install .to install all the dependencies needed in order to make the bot work. Wait until the process is finished.
First, if you didn't already do it, register your
bot with Discord. Then, create a file called .env in the project directory. Open your new .env file and add
DISCORD_TOKEN=<Your token> inside. (Replace by your discord token).
Do not share that file nor the information inside it to anyone.
When Grace is started, a database configuration file will automatically be generated. SQLite is the default database used in development. If you wish to change it, you can follow the instruction below.
In order for the bot to work, you need to connect it to a database. Supported databases are SQLite, MySQL/MariaDB, PostgresSQL, Oracle and Microsoft SQL Server. (Supported dialects)
To set up the connection to your database, create a new file in the config folder and call it database.cfg. You can
have three database configurations, one for each environment (production, test and development). Each section is
delimited by [database.<environment>].
The next step is to set up the adapter dialect + drivers (optional). The rest will depend on your database. Bellow, you'll find examples of common configuration.
You can also use
config/database.template.cfgto help you set up yourdatabase.cfg.
adapter = sqlite
database = grace.dbadapter = mysql
user = grace
password = GraceHopper1234
host = localhost
port = 3306adapter = postgresql+psycopg2
user = grace
password = GraceHopper1234
host = localhost
port = 5432All those can be bypassed by directly passing an url.
To create the database, tables and add the default data, execute the following commands:
grace db creategrace db seed
Don't forget to specify the environment you are using with
-e environment
- Verify that there is no issue already created for the changes you want to bring. If there is and no one is assigned to the issue, assign it to yourself.
- If there's no issue corresponding, create one. Don't forget to assign yourself the issue.
- Start by Forking the repository.
- From your forked repository, apply your changes to the code. Don't forget to setup your bot to test it.
- When you changes are done, open a PR.
Once your PR is submited, we (the staff) will review it with you. The first thing you're going to want to do is a self review.
We review every Pull Request. The purpose of reviews is to create the best code possible and ensure that the code is secured and respect the guidelines.
- Reviews are always respectful, acknowledging that everyone did the best possible job with the knowledge they had at the time.
- Reviews discuss content, not the person who created it.
- Reviews are constructive and start conversation around feedback.
You should always review your own PR first.
- Confirm that the changes meet the user experience and goals of the bot.
- Ensure that your code is clean and follows Python's PEP-0008.
- Verify your code for grammar and spelling mistakes (The code and the text must be in English).
- Test your changes to ensure there's no bugs.
Congratulate yourself, you did it! The Code Society thank you for helping us improve our community.
- The name of the PR must be the same as the issue related to the PR.
- The PR must be linked to the opened issue.
- The PR must describe what change have been done.
- Images or examples of the changes are more than welcome if necessary.
- The code must follow Python's PEP-0008.
- The code must be consistent and use descriptive names.
- The code must try to be the most modular as possible.
In case of doubt, don't hesitate to ask for help on the Discord server.
- All development has been tested on Linux. Running the bot on Windows could cause some issues or unexpected results.
- Note that we reserve the right to close and/or refuse any issue (Don't worry we will indicate why).
- Even after your PRs are merged, it may take some time to be applied on the server since the changes needs to be tested before entering in production.