... | ... | @@ -26,4 +26,25 @@ A minimal `pyproject.toml` file looks like: |
|
|
requires = ["setuptools", "wheel"]
|
|
|
build-backend = "setuptools.build_meta"
|
|
|
```
|
|
|
This needs to be done in all packages. |
|
|
\ No newline at end of file |
|
|
This needs to be done in all packages.
|
|
|
|
|
|
# QA
|
|
|
|
|
|
`pre-commit` is executed on the project at the start of any CI pipeline. It executes:
|
|
|
- `isort`
|
|
|
- `black`
|
|
|
- `flake8`
|
|
|
- various other things, like whitespace trimming or forcing a `newline` at the end of each file.
|
|
|
|
|
|
If any of those tests changes a file, the pipeline fails.
|
|
|
|
|
|
# Tests
|
|
|
|
|
|
Tests are run in CI pipelines. If your package contains tests, include the following line in `conda/meta.yaml`, in the `test.commands` section:
|
|
|
```yaml
|
|
|
- pytest --verbose --cov {{ name }} --cov-report term-missing --cov-report html:{{ project_dir }}/sphinx/coverage --cov-report xml:{{ project_dir }}/coverage.xml --junitxml {{ project_dir }}/test_results.xml --pyargs {{ name }}
|
|
|
```
|
|
|
|
|
|
Gitlab retrieves in the `project_dir` folder:
|
|
|
- `coverage.xml`: Contains the coverage report used in the badges of the project and in the Merge Request infos.
|
|
|
- `test_results.xml`: Contains the results of tests (*passed*, *skipped*, *error*, or *failed*) used in the `Tests` tab of CI pipelines to display a summary of tests without needing to read the log output. |
|
|
\ No newline at end of file |