| 1 |
# Babel Contribution Guidelines |
| 2 |
|
| 3 |
Welcome to Babel! These guidelines will give you a short overview over how we |
| 4 |
handle issues and PRs in this repository. Note that they are preliminary and |
| 5 |
still need proper phrasing - if you'd like to help - be sure to make a PR. |
| 6 |
|
| 7 |
Please know that we do appreciate all contributions - bug reports as well as |
| 8 |
Pull Requests. |
| 9 |
|
| 10 |
## Setting up a development environment and running tests |
| 11 |
|
| 12 |
After you've cloned the repository, |
| 13 |
|
| 14 |
1. Set up a Python virtualenv (the methods vary depending on tooling and operating system) |
| 15 |
and activate it. |
| 16 |
2. Install Babel in editable mode with development dependencies: `pip install -e .[dev]` |
| 17 |
3. Run `make import-cldr` to import the CLDR database. |
| 18 |
This will download the CLDR database and convert it to a format that Babel can use. |
| 19 |
4. Run `make test` to run the tests. You can also run e.g. `pytest --cov babel .` to |
| 20 |
run the tests with coverage reporting enabled. |
| 21 |
|
| 22 |
You can also use [Tox][tox] to run the tests in separate virtualenvs |
| 23 |
for all supported Python versions; a `tox.ini` configuration (which is what the CI process |
| 24 |
uses) is included in the repository. |
| 25 |
|
| 26 |
## On pull requests |
| 27 |
|
| 28 |
### PR Merge Criteria |
| 29 |
|
| 30 |
For a PR to be merged, the following statements must hold true: |
| 31 |
|
| 32 |
- All CI services pass. (Windows build, linux build, sufficient test coverage.) |
| 33 |
- All commits must have been reviewed and approved by a babel maintainer who is |
| 34 |
not the author of the PR. Commits shall comply to the "Good Commits" standards |
| 35 |
outlined below. |
| 36 |
|
| 37 |
To begin contributing have a look at the open [easy issues](https://github.com/python-babel/babel/issues?q=is%3Aopen+is%3Aissue+label%3Adifficulty%2Flow) |
| 38 |
which could be fixed. |
| 39 |
|
| 40 |
### Correcting PRs |
| 41 |
|
| 42 |
Rebasing PRs is preferred over merging master into the source branches again |
| 43 |
and again cluttering our history. If a reviewer has suggestions, the commit |
| 44 |
shall be amended so the history is not cluttered by "fixup commits". |
| 45 |
|
| 46 |
### Writing Good Commits |
| 47 |
|
| 48 |
Please see |
| 49 |
https://api.coala.io/en/latest/Developers/Writing_Good_Commits.html |
| 50 |
for guidelines on how to write good commits and proper commit messages. |
| 51 |
|
| 52 |
[tox]: https://tox.wiki/en/latest/ |