-
Notifications
You must be signed in to change notification settings - Fork 30
Pull request checks
The checks outlined in this document play a crucial role in maintaining the high quality of the project's codebase. By adhering to these checks, the code is kept maintainable, readable, and well-documented, which in turn improves the overall development process. The document provides an overview of the various checks that are performed when a pull request is submitted, as well as information on when and by whom these checks are conducted, and how to perform them yourself before filing a pull request.
- #Checking the code-style]
- #Building the documentation
- #Building the python package
- #Running the Python-only test cases
- #Running the third-party package test cases
In order to comply to the code style, you'll need to pass the flake8 style guide enforcement. These rulesets are set in the .flake8
file in the root directory of the f3dasm repository.
In the following pull request cases this check will be done:
- From
feature
topr/vX.X
- from
pr/vX.X
tomain
- hotfix
This check is done automatically by GitHub Actions whenever you file a pull request.
- Make sure you have flake8 installed (included with
requirements_dev.txt
):
pip install -U flake8
- Navigate to the root directory of the f3dasm repository
- run the following command in terminal:
flake8 .
This command will run flake8 following with the directory to check recursively for files
- If there are no errors, a error-code '0' will appear:
(f3dasm_env) martin@martin: ~/Github/F3DASM$ flake8 .
0
If you have files that you want to exclude from the style enforcement, you can add these to the he .flake8
file:
- Open the
.flake8
file in the root directory of the f3dasm repository - Add the file to the
extend-exclude
configuration
You will need to make sure that the documentation page can still be build. The documentation is build with sphinx
.
In the following pull request cases this check will be done:
- From
feature
topr/vX.X
- from
pr/vX.X
tomain
- hotfix
This check is done automatically by GitHub Actions whenever you file a pull request.
- Make sure you have the documentation dependencies installed (included with
requirements_dev.txt
):
pip install -r docs/requirements.txt
- Navigate to the documentation folder of the repository (
/docs/
) - Build the documentation with the following command:
sphinx-build -b html ./docs ./docs/_build/html
You can also run a handy Make command:
make html
- If the build was succesful, you will see the following message:
build succeeded.
The HTML pages are in _build/html
You will need to make sure the Python package can stil be build.
In the following pull request cases this check will be done:
- From
feature
topr/vX.X
- from
pr/vX.X
tomain
- hotfix
This check is done automatically by GitHub Actions whenever you file a pull request.
- Make sure you have the build dependencies installed (included with
requirements_dev.txt
):pip install -U setuptools wheel build
- Run the following command to build the package:
python -m build
- If the build was succesful, you will see the following message (replace
X.Y.Z
for the current version):
Successfully build f3dasm-X.Y.Z.tar.gz and f3dasm-X.Y.Z.whl
You will need to make sure that all available Python-only test pass when you change or implement a feature to the f3dasm framework. We use pytest
to configure the tests.
In the following pull request cases this check will be done:
- From
feature
topr/vX.X
- from
pr/vX.X
tomain
- hotfix
This check is done automatically by GitHub Actions whenever you file a pull request.
- Make sure you have the test dependencies installed (included with
requirements_dev.txt
):pip install -r tests/requirements.txt
- You can run the tests that are not marked by a non-Python dependency by executing
pytnon -m pytest -S all
- If the tests are passed , you will see the following message:
Required test coverage of 70.0% reached. Total coverage: XX.XX%
========= X passed, X skipped, X warnings in 91.49s (0:01:31) =========
For the Python-only tests, a minimum of 70% code coverage is required. Click Testing#Code coverage for more information about code coverage.
Apart from the Python-only functionalities, f3dasm
will depend on some third-party software that is not supported by GitHub Actions. These test cases have to be run on machine that supports this software.
In the following pull request cases this check will be done:
- from
pr/vX.X
tomain
- hotfix
This check is done manually by the reviewer
- Make sure you have the test dependencies installed (included with
requirements_dev.txt
):pip install -r tests/requirements.txt
- You can run the tests that are marked by a non-Python dependency by executing
pytnon -m pytest requires_dependency
- If the tests are passed , you will see the following message:
Required test coverage of 70.0% reached. Total coverage: XX.XX%
========= X passed, X skipped, X warnings in 91.49s (0:01:31) =========