Skip to content

Commit 87901f6

Browse files
authored
Merge pull request #161 from guilieb/fix/contributing
Review of CONTRIBUTING & Documentation before general availability
2 parents 9d6e612 + e1ebe46 commit 87901f6

16 files changed

Lines changed: 223 additions & 357 deletions

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,50 @@
11
---
22
name: Bug report
3-
about: Create a report to help us improve
3+
about: Create a report to help us improve Melusine
44
title: ''
55
labels: 'type:bug'
66
assignees: ''
77
---
88

9-
Hey there and thank you for using Issue Tracker!
9+
Hey there, and thank you for using Melusine's Issue Tracker!
1010

1111
Do the checklist before filing an issue:
1212

13-
- Is this something you can debug and fix? Send a pull request ! Bug fixes and documentation fixes are welcome.
14-
- Have a usage question ? Ask your question on StackOverflow. We use StackOverflow for usage question and GitHub for bugs.
13+
- Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
14+
- Have a usage question? Ask your question on StackOverflow. We use StackOverflow for usage question and GitHub for bugs.
1515

16-
None of the above, create a bug report
16+
None of the above, create a bug report!
1717

1818
Make sure to add all the information needed to understand the bug so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information.
1919

20+
## Instructions
21+
2022
- Provide a minimal code snippet example that reproduces the bug.
21-
- Provide screenshots where appropriate
22-
- What's the version of Python you're using ?
23-
- Are you using Mac, Linux or Windows?
23+
- Provide screenshots where appropriate.
24+
- What's the version of Python you're using?
25+
- Are you using Mac, Linux or Windows? On Linux, provide details about your distribution.
26+
27+
## Debug Information
28+
29+
Please write the debug information inside <code>```</code> quotes in order to prevent text interpretation by the text editor.
30+
31+
**Operating System**: (run `cat /etc/os-release` in a terminal if running on a GNU/Linux distribution)
32+
33+
```
34+
```
35+
36+
**Python version**: (run `python --version` in the environment running Melusine)
37+
38+
```
39+
```
40+
41+
**Melusine version**: (run `pip freeze |grep melusine` in your Python environment)
42+
43+
```
44+
```
2445

25-
**Python version** :
46+
**Python packages**: (run `pip freeze` in your Python environment)
2647

27-
**Melusine version** :
48+
```
49+
```
2850

29-
**Operating System** :

CONTRIBUTING.md

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to contribute to Melusine Open source
22

3-
This guide aims to help you contributing to Melusine. If you have found any problems, improvements that can be done, or you have a burning desire to develop new features for Melusine, please make sure to follow the steps bellow.
3+
This guide aims to help you contribute to Melusine. If you have found any problems, improvements that can be done, or you have a burning desire to develop new features for Melusine, please make sure to follow the steps bellow.
44

55
- [How to open an issue](#how-to-open-an-issue)
66
- [Create your contribution to submit a pull request](#create-your-contribution-to-submit-a-pull-request)
@@ -18,14 +18,14 @@ This guide aims to help you contributing to Melusine. If you have found any prob
1818

1919
An issue will open a discussion to evaluate if the problem / feature that you submit is eligible, and legitimate for Melusine.
2020

21-
Check on the project tab if your issue / feature is not already created. In this tab, you will find the roadmap of Melusine.
21+
Before opening any new issue, check on the project tab if your issue / feature is not already created. We would like to avoid duplicates. In this tab, you will find the roadmap of Melusine.
2222

23-
A Pull Request must be linked to an issue.
24-
Before you open an issue, please check the current opened issues to insure there are no duplicate. Define if it's a feature or a bugfix.
23+
A Pull Request must be linked to an issue. Whether it is a bugfix or a feature request, please specify the labels **bug** or **enhancement**.
2524

2625
Next, the Melusine team, or the community, will give you a feedback on whether your issue must be implemented in Melusine, or if it can be resolved easily without a pull request.
2726

2827
# Create your contribution to submit a pull request
28+
2929
## Fork to code in your personal Melusine repo
3030

3131
The first step is to get our MAIF repository on your personal GitHub repositories. To do so, use the "Fork" button.
@@ -42,96 +42,99 @@ Click on the "Code" button to copy the url of your repository, and next, you can
4242
git clone https://github.com/YOUR_GITHUB_PROFILE/melusine.git
4343
```
4444

45-
## Make sure that your repository is up to date
45+
## Make sure that your repository is up-to-date
4646

47-
To insure that your local forked repository is synced, you have to update your repo with the master branch of Melusine (MAIF). So, go to your repository and as follow :
47+
To ensure that your local forked repository is synced with the upstream version available in this repository, you have to update your repo with the `master` branch of Melusine (managed by MAIF). So, go to your repository and as follows:
4848

4949
```
5050
cd melusine
5151
git remote add upstream https://github.com/MAIF/melusine.git
5252
git pull upstream master
5353
```
5454

55-
## Install Melusine into a virtualenv
55+
## Install Melusine into a Python `virtualenv`
5656

57-
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
57+
Install your local Python environment using the `venv` module of recent Python versions. Read the instructions below to build this environment for local deployments:
5858

59-
First create a python virtual environment
59+
First create a Python virtual environment. Python 3.8+ is required.
6060
```
61-
mkvirtualenv melusine
61+
python -m venv melusine-pyenv
6262
```
63-
Go in the melusine directory
63+
64+
Activate the environment. This step is required every time you will contribute to the development of Melusine. For more information about Python virtual environments, [read the official documentation](https://docs.python.org/3/library/venv.html). Your environment is next to the Melusine project, stored in the `melusine` directory.
6465
```
65-
cd melusine
66+
source melusine-pyenv/bin/activate
6667
```
67-
Install you local package
68+
69+
Then, go to the melusine directory and install the local packages.
6870
```
69-
python setup.py develop
71+
cd melusine
7072
```
71-
or
73+
74+
Then, install the dependencies using `pip`. You can add the `-e` option to keep the last modifications dynamically stored in your virtual env.
7275
```
73-
pip install -e .
76+
pip install .
7477
```
75-
or to have optionnal dependencies
78+
79+
There are many other targets available to add dependencies: `dev`, `tests`, `transformers`, `docs`. You can install them like:
7680
```
77-
pip install ".[transformers]"
81+
pip install ".[dev]"
7882
```
7983

80-
## Start your contribution code
84+
## Start your Contribution Code
85+
86+
To contribute to Melusine, you will need to create a personal branch on which you will be responsible for your changes. This means you will have to ensure your tests pass and you only modify the code related to your changes. You have to install the dependencies of the `dev` target.
8187

82-
To contribute to Melusine, you will need to create a personal branch.
8388
```
8489
git checkout -b feature/my-contribution-branch
8590
```
86-
We recommand to use a convention of naming branch.
87-
- **feature/your_feature_name** if you are creating a feature
88-
- **hotfix/your_bug_fix** if you are fixing a bug
8991

90-
## Commit your changes
92+
We recommend to use a convention of naming branch:
93+
- **feature/your_feature_name** if you are creating a feature.
94+
- **hotfix/your_bug_fix** if you are fixing a bug.
95+
96+
## Commit Your Changes
9197

92-
Before committing your modifications, we have some recommendations :
98+
Before committing your modifications, we have some recommendations:
9399

94-
- Execute pytest to check that all tests pass
100+
- Execute `pytest` to check that all tests pass.
95101
```
96102
pytest
97103
```
98-
- Try to build Melusine
104+
105+
- Try to build Melusine.
99106
```
100-
python setup.py bdist_wheel
107+
python -m build
101108
```
102-
- Check your code with **flake8**
103-
104-
*We will soon add **pre commit** to automatically check your code quality during commit*
105109

110+
- Use the `pre-commit` configuration.
106111
```
107-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
108-
```
112+
# Installation + auto-configuration of pre-commit
113+
pip install pre-commit
114+
pre-commit install
109115
110-
Also for now, try testing tox. It will not be used for much longer as we will be moving to Github Actions and a simpler process soon.
116+
# Initial run
117+
pre-commit run --all-files
118+
```
111119

120+
- Call `tox` to execute more automated tests.
112121
```
113122
tox
114123
```
115124

116-
To get flake8 and tox, just pip install them into your virtualenv.
117-
118-
In addition, we recommend committing with clear messages and grouping your commits by modifications dependencies.
125+
In addition, we recommend committing with clear messages and grouping your commits by modifications dependencies. Read this [GitHub Gist](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53) to have an idea of what we have in mind when speaking of which.
119126

120127
Once all of these steps succeed, push your local modifications to your remote repository.
121-
122128
```
123-
git add .
124-
git commit -m ‘detailed description of your change’
129+
git add YOUR_FILES_WHAT WHERE_MODIFIED
130+
git commit
125131
git push origin feature/my-contribution-branch
126132
```
127133

128-
Your branch is now available on your remote forked repository, with your changes.
129-
130-
Next step is now to create a Pull Request so the Melusine Team can add your changes to the official repository.
134+
Your branch is now available on your remote forked repository, with your changes. Next step is now to create a Pull Request so the Melusine Team can review and merge your changes to the official repository.
131135

132136
## Create a Pull Request
133137

134-
135138
A pull request allows you to ask the Melusine team to review your changes, and merge your changes into the master branch of the official repository.
136139

137140
To create one, on the top of your forked repository, you will find a button "Compare & pull request"
@@ -153,15 +156,14 @@ Once you have selected the right branch, let's create the pull request with the
153156

154157
<img src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/melusine-pr-description.png" alt="clone your forked repository" />
155158

156-
In the description, a template is initialized with all informations you have to give about what you are doing on what your PR is doing.
159+
In the description, a template is initialized with all information you have to give about what you are doing on what your PR is doing.
157160

158161
Please follow this to write your PR content.
159162

160-
161-
## Finally submit your pull request
163+
## Finally, submit your pull request
162164

163165
Your pull request is now ready to be submitted. A member of the Melusine team will contact you and will review your code and contact you if needed.
164166

165-
You have contributed to an Open source project, thank you and congratulations ! 🥳
167+
You have contributed to an Open source project, thank you and congratulations! 🥳
166168

167-
Show your contribution to Melusine in your curriculum, and share it on your social media. Be proud of yourself, you gave some code lines to the entire world !
169+
Show your contribution to Melusine in your curriculum, and share it on your social media. Be proud of yourself, you gave some code lines to the entire world!

CONTRIBUTING.rst

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)