You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case you also want to automatically create a valid Github release, you also need to provide a valid `GITHUB_TOKEN` as a secret (`-s GITHUB_TOKEN=<token>`).
102
+
In case you also want to automatically create a valid Github release, you also need to provide a valid `GITHUB_TOKEN` as a secret (`-s GITHUB_TOKEN=<token>`). Please refer to the next section for information on how to finish and publish the release.
103
+
104
+
##### Via Github Actions
105
+
106
+
To trigger our release pipeline from Github UI, you can either close a milestone that has a valid version name (`vMAJOR.MINOR.PATCH`) or execute the release pipeline manually via the `workflow_dispatch` UI in the Action Tab (`Actions -> release-pipeline -> Run Workflow`). The release pipeline will automatically create a pull request for the new version as well as a draft release on Github.
107
+
108
+
After successful execution of the release pipeline, the following steps are required to finish the release:
109
+
110
+
1. Merge the release PR into `main`. Preferably via merge commit to keep the version tag in the `main` branch. We suggest to use the following message for the merge commit: `Finalize release for version <VERSION> (#<PR>)`.
111
+
2. Adapt the changelog of the draft release on Github (in the release section). Mention all other changes that are not covered by pull requests.
112
+
3. Publish the release.
113
+
114
+
##### Resolve an unsuccessful release
115
+
116
+
In case the release pipeline fails at any step, we suggest to fix the problem based on the release pipeline logs and create a new release with an incremented `patch` version. To clean up the unsuccessful release, make sure to delete the following artifacts (if they exist): the release branch, the release PR, the version tag, the draft release, and any release artifact that was already published (e.g. on DockerHub, NPM or PyPi).
103
117
104
118
##### Via Github Actions
105
119
@@ -148,7 +162,9 @@ Commit messages should be as standardized as possible within the repository. A f
- Use type hints wherever possible: [Cheatsheet](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html)
153
169
- Minimum compatibility: Python 3.6
154
170
@@ -163,17 +179,17 @@ Commit messages should be as standardized as possible within the repository. A f
163
179
We use [black](https://github.com/ambv/black) for code formatting and [isort](https://github.com/PyCQA/isort) for import sorting. The following commands run `black` and `isort` on all Python files of the component (when executed in the component root):
164
180
165
181
```bash
166
-
python -m isort --profile black src
167
-
python -m black src
182
+
isort --profile black src
183
+
black src
168
184
```
169
185
170
186
If you want to only check if the formatting and sorting is applied correctly to all files, execute:
171
187
172
188
```bash
173
189
# formatting check:
174
-
python -m black --check src
190
+
black --check src
175
191
# import sorting check:
176
-
python -m isort --profile black --check-only src
192
+
isort --profile black --check-only src
177
193
```
178
194
179
195
You can also configure `black` and `isort` inside your code editor. For example, if you're using [Visual Studio Code](https://code.visualstudio.com/) with the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python), you can add the following to your `settings.json` for formatting and auto-format your files on save:
@@ -205,11 +221,11 @@ We use [flake8](https://github.com/PyCQA/flake8) for linting, [mypy](https://git
205
221
206
222
```bash
207
223
# type checks
208
-
python -m mypy src
224
+
mypy src
209
225
# linting
210
-
python -m flake8 src
226
+
flake8 src
211
227
# docstring checks
212
-
python -m pydocstyle src
228
+
pydocstyle src
213
229
```
214
230
215
231
You can also configure `flake8`, `mypy`, and `pydocstyle` inside your code editor. For example, if you're using [Visual Studio Code](https://code.visualstudio.com/) with the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python), you can add the following to your `settings.json` for linting and type checking:
@@ -234,12 +250,13 @@ You can also configure `flake8`, `mypy`, and `pydocstyle` inside your code edito
234
250
We use the [pytest](http://doc.pytest.org/) framework for testing. For more info on this, see the [pytest documentation](http://docs.pytest.org/en/latest/contents.html). Tests for modules and classes live in their own directories of the same name inside the `tests` folder. To be discovered, all test files and test functions need to be prefixed with `test_`. To run the test suite, execute:
235
251
236
252
```bash
237
-
# run test suite:
238
-
python -m pytest .
253
+
# Run full test suite:
254
+
pytest
255
+
# Exclude all slow tests
256
+
pytest -m "not slow"
239
257
```
240
258
241
-
When adding tests, make sure to use descriptive names, keep the code short and concise and only test for one behavior at a time. Try to `parametrize` test cases wherever possible and avoid unnecessary imports. Extensive tests that take a long time should be marked with `@pytest.mark.slow`.
242
-
259
+
When adding tests, make sure to use descriptive names, keep the code short and concise and only test for one behavior at a time. Try to avoid unnecessary imports and use `parametrize` test cases wherever possible. Parametrizing tests allows to test multiple inputs to a function and verify that they return the expected output. Use [fixtures](https://docs.pytest.org/en/stable/fixture.html) to share test setups with - optional - setup and tear-down routines. Fixtures can also be parameterized. Extensive tests that take a long time should be marked with `@pytest.mark.slow`.
243
260
## Code of Conduct
244
261
245
262
All members of the project community must abide by the [Contributor Covenant, version 2.0](./.github/CODE_OF_CONDUCT.md). Only by respecting each other we can develop a productive, collaborative community. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer.
0 commit comments