Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edits to contribution instructions #714

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Lint with black
run: black --check --diff --color .
- name: Check import order with isort
run: isort -v -l 88 -o opacus --lines-after-imports 2 -m 3 --trailing-comma --check-only .
run: isort -l 88 -o opacus --lines-after-imports 2 -m 3 --trailing-comma --check-only .

########### UNIT TESTS ##############
unittest_py38_torch_release:
Expand Down
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ for advanced usage).

Opacus also uses [isort](https://github.com/timothycrosley/isort) to sort imports
alphabetically and separate into sections. isort is installed easily via
pip using `pip install isort`, and run locally by calling
pip using `pip install isort --upgrade`, and run locally by calling
```bash
isort -v -l 88 -o opacus --lines-after-imports 2 -m 3 --trailing-comma .
isort -l 88 -o opacus --lines-after-imports 2 -m 3 --trailing-comma .
```
from the repository root. Configuration for isort is located in .isort.cfg.
If using `isort` versions `<5.0.0` call
```bash
isort -l 88 -o opacus --lines-after-imports 2 -m 3 --trailing-comma --recursive
```


We feel strongly that having a consistent code style is extremely important, so
CircleCI will fail on your PR if it does not adhere to the black or flake8 formatting style or isort import ordering.
Expand Down Expand Up @@ -96,7 +101,7 @@ Run following command from `website` folder. It will build the docs and serve th
```

You can also perform spell checks on documentation automatically (besides IDEs) using [```sphinxcontrib-spelling```](https://sphinxcontrib-spelling.readthedocs.io/en/latest/install.html)
Note that you will also need [```PyEnchant```](https://pyenchant.github.io/pyenchant/) to run ```sphinxcontrib-spelling```, and thus the Enchant C library. Use this guide for ```PyEnchant```.
Note that you will also need [```PyEnchant```](https://pyenchant.github.io/pyenchant/) to run ```sphinxcontrib-spelling```, and thus the Enchant C library. Use this guide for ```PyEnchant```.

Steps:
1. Install the extension with pip: ```pip install sphinxcontrib-spelling```
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ flake8
sphinx
sphinx-autodoc-typehints
mypy>=0.760
isort
isort>=5.0.0
hypothesis
tensorboard
datasets
Expand Down
2 changes: 2 additions & 0 deletions research/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ We warmly welcome and encourage contributions of new methods! To contribute, ple
1. Fork the repo and create your branch from `main`.
2. Place the new method in a separate subfolder within the `research` directory.
3. The new folder should include a `README.md` that explains the method at a high level, demonstrates usage (e.g., introducing new parameters to the `PrivacyEngine`), and cites relevant sources. The subfolder name should aptly represent the method.
4. Format code using `black`, `flake8`, and `isort` following the instructions under `Code Style` [here](https://github.com/pytorch/opacus/blob/main/CONTRIBUTING.md).
5. Add copyright headers to each `.py` file contributed in the format `# Copyright (c) [copy-right holder]`.

More detailed PR instructions can be found [here](https://github.com/pytorch/opacus/blob/main/CONTRIBUTING.md).

Expand Down
Loading