- Read the contributing guidelines
- Check if your changes are consistent with the guidelines
- Refer to the Linux/Mac users section if your development environment is either Linux or Mac.
- Refer to the Windows users section if your development environment is Windows.
- Include unit tests when you contribute new features, as they help to:
- Prove that your code works correctly.
- Guard against future breaking changes to lower the maintenance cost.
- Bug fixes also generally require unit tests, because the presence of bugs usually indicates insufficient test coverage.
- Make sure that your code changes complies with the coding style of the project.
- Keep API compatibility in mind when you change code. Reviewers of your pull request will comment on any API compatibility issues.
For contributors using either Linux or Mac operating systems, we have created a makefile
which will help you get all the setup done in just a few commands. The make
commands will create the virtual environment and install all the required dependencies on your system.
Every Pull Request submitted will be checked on every supported Python version, in your on-going development, you can run the following command to verify the unit tests:
make test
when finishing with your development and prior to creating a pull request, run the following command in order to run the tests on every supported python version, thus validating that your PR tests will pass.
make tox
Changes to Python code should pass both linting and docstring check. You can run the following command in order to validate your code style using pylint
and pydocstring
:
make validate
To verify whether your changes has affected the test coverage, you can run the following command:
make coveralls
To generate the documentation, you can run the following commnad:
make docs
For contributors using Windows operating system, you have to manually run the following commands since as of now the make
commands works with Linux/Mac OS. BTW, If you have a fix for that you are more than welcome to contribute!
To create a virtual environment in python, run the following command:
python -m venv <name_of_your_virtual_environment>
Once your virtual environment is set up, activate your virtual environment by executing the command: ./venv/Scripts/Activate.ps1
. Then, install the dependencies for your virtual environment by running the following command:
To install regular dependencies:
pip install -r .\requirements\requirements.txt
To install development dependencies:
pip install -r .\requirements\dev-requirements.txt
To install NLP related dependencies:
pip install -r .\requirements\nlp-requirements.txt
To install NLP properties related dependencies:
pip install -r .\requirements\nlp-prop-requirements.txt
To install vision development dependencies:
pip install -r .\requirements\vision-requirements.txt
Once you have installed all the dependencies, you are ready to work on the project.
To verify and execute all the unit tests, run the following command:
pytest .\tests
If you want to execute specific tests, execute the commands as follows:
# Execute NLP tests
pytest .\tests\nlp\
# Execute vision tests
pytest .\tests\vision\
# Execute tabular tests
pytest .\tests\tabular\
Changes to Python code should pass both linting and docstring check. In order to validate your code style, you can run the following commands:
# To run pylint on all the files
pylint deepchecks
# To run pylint on specific file
pylint .\deepchecks\nlp\utils\text_properties.py
# To run pydocstyle on all the files
python -m pydocstyle --convention=pep257 --add-ignore=D107 deepchecks