ENGLISH | PORTUGUÊS
Thank you for dedicating your time to contribute! 🙇♀️🙇♂️ All help is welcome!
How to make your first contribution:
- 1. Create a GitHub Account
- 2. Find an Issue to Work On
- 3. Install Git
- 4. Fork the Project
- 5. Clone Your Fork
- 6. Create a New Branch
- 7. Run PyFlunt Locally
- 8. Make Your Changes
- 9. Test Your Changes
- 10. Commit and Push Your Changes
- 11. Add Entries to CHANGELOG.md
- 12. Create a PR on GitHub
- 13. Update Your Branch if Necessary
Make sure to have a GitHub account and be logged in.
Visit the PyFlunt issues page and find an issue you would like to work on that hasn't been assigned to anyone yet.
Leave a comment on the issue asking if you can work on it. Something like: "Hello, can I work on this issue?".
Wait until someone assigns the issue to you. Once assigned, you can proceed to the next step.
Feel free to ask any questions on the issue page before or during the development process.
When starting to contribute to the project, it's recommended to take one issue at a time. This helps ensure that other people also have the opportunity to collaborate and prevents resources from remaining inactive for too long.
Make sure to have Git installed.
Clone your fork locally.
Navigate to the PyFlunt folder:
$ cd pyflunt
And create a new branch:
$ git checkout -b <issue_number>
Create a virtualenv for PyFlunt and activate it:
$ poetry shell
Install dependencies:
$ poetry install
$ poetry pre-commit-install
Now you can use it in the same way described in the README.md file.
$ poetry test
Now is the stage where you can implement your changes in the code.
It's important to note that we document our code using docstrings. Modules, classes, functions, and methods should be documented. Your changes should also be well documented and reflect updated docstrings, in case any parameters have been changed for a class/attribute or even functions.
All docstrings should be in English. Feel free to use Google Translate if necessary. We will suggest changes in the translation if needed, so don't worry about possible English errors.
We follow the pattern below to maintain consistency in docstrings:
class Example:
"""Explain the purpose of the class
Attributes:
-----------
x[dict]: Short explanation here
y[type, optional]: Short explanation here
Methods:
-------
- foobar(w): Short explanation here
"""
def __init__(self, x, y=None):
self.x = x
self.y = y
def foobar(self, w):
"""Purpose if the function
Parameters
----------
`w`: str
Short explanation here
Returns:
--------
`value`: str
Short explanation here
Notes:
------
- Describe conditions here
Examples:
---------
```python
obj = Example(1)
obj.foobar(2) >> Returns
```
"""
...
return value
One thing to keep in mind when documenting code with docstrings is that you can ignore docstrings in property decorators and magic methods.
Make sure you have created the necessary tests for each new change you made.
Run all tests with poetry test
and make sure they all pass.
PRs will not be merged if there are any missing or failing tests.
Commit your changes:
$ git commit -a -m "<commit_message>"
Push your commit to GitHub:
$ git push --set-upstream origin <issue_number>
Create as many changes/commits as you need and push them.
Ensure your branch is updated with the main
Here you will find how to release a new production version of brutils:
For the creation of the issue, you can use the feature template, with the name of the issue being Release v<version>
. Example
The name of the branch created for the release is related to the number of the Issue, as shown in this example
Increment the version number, following the Semantic Versioning,
in the pyproject.toml
file:
Add a title for the new version with the new number and the current date, as [in this example](https://github.com/fazedordecodigo/pyflunt/blob
/main/CHANGELOG.md?plain=1#L9).
And add the version links, as in this example
Edit the release.yml
file at line 46
with the new version (ex: v2.0.0
),
line 47
with the release name (ex: Release v2.0.0
) and from line 49
onwards add the changed changelog section.
release.yml
Create a PR with the name Release v<version>
containing the two changes above. In the description of the Pull Request, add the changed changelog section.
Once the PR is accepted and passes all checks, merge it.
After the PR approval and merge into main, the release of the new version in production will be done automatically via Github Actions.
When Deploy via GitHub is completed, the new version will also be automatically released on PyPI. Download the new version of PyFlunt from PyPI and test if everything is working as expected.