We want to make contributing to pytorch-dp is as easy and transparent as possible.
To get the development installation with all the necessary dependencies for linting, testing, and building the documentation, run the following:
git clone https://github.com/facebookresearch/pytorch-dp.git
cd pytorch-dp
pip install -e .[dev]
pytorch-dp uses the black code formatter to
enforce a common code style across the code base. black is installed easily via
pip using pip install black
, and run locally by calling
black .
from the repository root. No additional configuration should be needed (see the black documentation for advanced usage).
We feel strongly that having a consistent code style is extremely important, so Travis will fail on your PR if it does not adhere to the black formatting style.
pytorch-dp is fully typed using python 3.6+ type hints. We expect any contributions to also use proper type annotations. While we currently do not enforce full consistency of these in our continuous integration test, you should strive to type check your code locally. For this we recommend using pyre.
To run the unit tests, you can either use pytest
(if installed):
pytest -ra
or python's unittest
:
python -m unittest
To get coverage reports we recommend using the pytest-cov
plugin:
pytest -ra --cov=. --cov-report term-missing
At this preview stage, we do not yet have a documentation website. Stay tuned for more!
We actively welcome your pull requests.
- Fork the repo and create your branch from
master
. - If you have added code that should be tested, add unit tests. In other words, add unit tests.
- If you have changed APIs, document the API change in the PR.
- Ensure the test suite passes.
- Make sure your code passes both
black
andflake8
formatting checks.
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.
Facebook has a bounty program for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
By contributing to pytorch-dp, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree.