|
| 1 | +Contribuer | Contributing |
| 2 | +========================= |
| 3 | + |
| 4 | +You will find instructions in English in the section `Contributing`_. |
| 5 | + |
| 6 | +Vous trouverez les instructions en français dans la section `Contribuer`_. |
| 7 | + |
| 8 | +Contribuer |
| 9 | +---------- |
| 10 | + |
| 11 | +Vous êtes tous invités à contribuer à ce projet pour le maintenir ou l'améliorer. |
| 12 | +Même si vous n'êtes pas un développeur, vous pouvez sûrement donner un coup de |
| 13 | +main en remontant les bugs constatés, en partageant vos idées d'amélioration ou |
| 14 | +en participant à la documentation. |
| 15 | + |
| 16 | +Préparer votre environement de développement |
| 17 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | + |
| 19 | +Vous aurez besoin de Python 3.6+ et des outils suivants: |
| 20 | + |
| 21 | +- Poetry_ |
| 22 | +- Nox_ |
| 23 | + |
| 24 | +Installez le package avec les dépendances de développement: |
| 25 | + |
| 26 | +.. code:: console |
| 27 | +
|
| 28 | + $ poetry install |
| 29 | +
|
| 30 | +Vous pouvez maintenant utiliser une session interactive Python: |
| 31 | + |
| 32 | +.. code:: console |
| 33 | +
|
| 34 | + $ poetry run python |
| 35 | +
|
| 36 | +Je vous recommande d'installer un pre-commit-hook pour lancer automatiquement quelques |
| 37 | +vérfication avant de commit vos modifications. |
| 38 | + |
| 39 | +.. code:: console |
| 40 | +
|
| 41 | + $ nox -s pre-commit -- install |
| 42 | +
|
| 43 | +Tester le projet |
| 44 | +^^^^^^^^^^^^^^^^ |
| 45 | + |
| 46 | +Dérouler la suite de tests complète: |
| 47 | + |
| 48 | +.. code:: console |
| 49 | +
|
| 50 | + $ nox |
| 51 | +
|
| 52 | +Lister toutes les sessions disponibles dans Nox: |
| 53 | + |
| 54 | +.. code:: console |
| 55 | +
|
| 56 | + $ nox --list-sessions |
| 57 | +
|
| 58 | +Vous pouvez lancer une session Nox spécifique. Par exemple, lancez la suite de |
| 59 | +tests unitaires avec: |
| 60 | + |
| 61 | +.. code:: console |
| 62 | +
|
| 63 | + $ nox --session=tests |
| 64 | +
|
| 65 | +Les tests unitaires sont dans le répertoire `tests` et utilisent le framework pytest. |
| 66 | + |
| 67 | +Soumettre votre Pull Request (PR) |
| 68 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 69 | + |
| 70 | +Ouvrez une `pull request`_ pour proposer des changements à ce projet. |
| 71 | + |
| 72 | +Votre pull request doit vérifier les conditions suivantes pour être acceptée: |
| 73 | + |
| 74 | +* La suite de tests Nox doit réussir sans erreurs ni warning. |
| 75 | +* Doit inclure des tests unitaires. Ce projet maintien une couverture de code à 100%. |
| 76 | + |
| 77 | +Proposer une nouvelle fonctionnalité |
| 78 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 79 | + |
| 80 | +Pour proposer vos idées d'amélioration, ouvrez une `issue <https://github.com/hacf-fr/meteofrance-api/issues>`_ |
| 81 | +en utilisant le modèle ``feature request``. |
| 82 | + |
| 83 | +Contributing |
| 84 | +------------ |
| 85 | + |
| 86 | +You are all invited to contribute to this project for maintenance or improvement. |
| 87 | +Even if you are not a developer, you can help to report some bugs, share |
| 88 | +improvements ideas, or contribute to the documentation. |
| 89 | + |
| 90 | +How to set up your development environment |
| 91 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 92 | + |
| 93 | +You need Python 3.6+ and the following tools: |
| 94 | + |
| 95 | +- Poetry_ |
| 96 | +- Nox_ |
| 97 | + |
| 98 | +Install the package with development requirements: |
| 99 | + |
| 100 | +.. code:: console |
| 101 | +
|
| 102 | + $ poetry install |
| 103 | +
|
| 104 | +You can now run an interactive Python session, or the command-line interface: |
| 105 | + |
| 106 | +.. code:: console |
| 107 | +
|
| 108 | + $ poetry run python |
| 109 | +
|
| 110 | +I recommand to install a pre-commit-hook to have some checks done automatically before you commit your changes. |
| 111 | + |
| 112 | +.. code:: console |
| 113 | +
|
| 114 | + $ nox -s pre-commit -- install |
| 115 | +
|
| 116 | +How to test the project |
| 117 | +^^^^^^^^^^^^^^^^^^^^^^^ |
| 118 | + |
| 119 | +Run the full test suite: |
| 120 | + |
| 121 | +.. code:: console |
| 122 | +
|
| 123 | + $ nox |
| 124 | +
|
| 125 | +List the available Nox sessions: |
| 126 | + |
| 127 | +.. code:: console |
| 128 | +
|
| 129 | + $ nox --list-sessions |
| 130 | +
|
| 131 | +You can also run a specific Nox session. For example, invoke the unit test suite like this: |
| 132 | + |
| 133 | +.. code:: console |
| 134 | +
|
| 135 | + $ nox --session=tests |
| 136 | +
|
| 137 | +Unit tests are located in the tests directory, and are written using the pytest testing framework. |
| 138 | + |
| 139 | +How to submit changes |
| 140 | +^^^^^^^^^^^^^^^^^^^^^ |
| 141 | + |
| 142 | +Open a `pull request`_ to submit |
| 143 | +changes to this project. |
| 144 | + |
| 145 | +Your pull request needs to meet the following guidelines for acceptance: |
| 146 | + |
| 147 | +- The Nox test suite must pass without errors and warnings. |
| 148 | +- Include unit tests. This project maintains 100% code coverage. |
| 149 | + |
| 150 | +Feature suggestion |
| 151 | +^^^^^^^^^^^^^^^^^^ |
| 152 | + |
| 153 | +If you want to suggest a new feature for this project, please open an `issue <https://github.com/hacf-fr/meteofrance-api/issues>`_ |
| 154 | +by using the `feature request` template. |
| 155 | + |
| 156 | +.. _Poetry: https://python-poetry.org/ |
| 157 | +.. _Nox: https://nox.thea.codes/ |
| 158 | +.. _pull request: https://github.com/hacf-fr/meteofrance-api/pulls |
0 commit comments