Skip to content

Latest commit

 

History

History
227 lines (151 loc) · 6.32 KB

CONTRIBUTING.rst

File metadata and controls

227 lines (151 loc) · 6.32 KB

Contributing Guidelines

Pull Request Checklist

General guidelines for contribution

  • 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.

Linux and Mac Users

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.

Running Unit Tests

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

Coding Style

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

Test Coverage

To verify whether your changes has affected the test coverage, you can run the following command:

make coveralls

Generate Docs

To generate the documentation, you can run the following commnad:

make docs

Windows Users

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!

Creating virtual environment

To create a virtual environment in python, run the following command:

python -m venv <name_of_your_virtual_environment>

Installing dependencies

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.

Running Unit Tests

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\

Coding Style

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