diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 79bc86b99fbb..880d6601fcef 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -9,7 +9,7 @@ jobs: with: python-version: '3.7' - run: | - python -m pip install autopep8 black "isort==4.3.21" + python -m pip install autopep8 "black==19.10b0" "isort==4.3.21" isort -rc . autopep8 --recursive --in-place --aggressive --aggressive . black . diff --git a/.travis.yml b/.travis.yml index ffa8713da077..d49b074e36a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ jobs: - stage: Lint check python: "3.7" before_install: # Nothing to do - install: pip install flake8 black "isort==4.3.21" + install: pip install flake8 "black==19.10b0" "isort==4.3.21" script: - flake8 . - black --check . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0c8a71625b9..56c409f8ae63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,25 +34,38 @@ If you modify the code, you will most probably also need to code some tests to e New code should be compatible with Python 3.X versions. Once you finish implementing a feature or bugfix and tests, please run lint checking and tests: -#### Formatting Code without pre-commit -If you choose not to use pre-commit, you can take advantage of IDE extensions configured to black format or invoke black manually to format files and commit them. +#### Formatting Code + +To ensure the codebase complies with a style guide, we use [flake8](https://flake8.pycqa.org/en/latest/), +[black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isort/) tools to +format and check codebase for compliance with PEP8. To install those tools with pip, please run + +```bash +pip install flake8 "black==19.10b0" "isort==4.3.21" +``` + +##### Formatting without pre-commit + +If you choose not to use pre-commit, you can take advantage of IDE extensions configured to black format or invoke +black manually to format files and commit them. ```bash -pip install black -black . # This should autoformat the files +isort -rc . +black . +# Run lint checking +flake8 ignite/ tests/ examples/ +# If everything is OK, then commit git add . -git commit -m "....." +git commit -m "Added awesome feature" ``` -#### with pre-commit - -To ensure the codebase complies with a style guide, we use [black](https://black.readthedocs.io/en/stable/) and [flake8](https://flake8.pycqa.org/en/latest/) to format and check codebase for compliance with PEP8. +#### Formatting with pre-commit To automate the process, we have configured the repo with [pre-commit hooks](https://pre-commit.com/) to use black to autoformat the staged files to ensure every commit complies with a style guide. This requires some setup, which is described below: 1. Install pre-commit in your python environment. -2. Run pre-commit install that configures a virtual environment to invoke black and flake8 on commits. +2. Run pre-commit install that configures a virtual environment to invoke black, isort and flake8 on commits. ```bash pip install pre-commit @@ -67,20 +80,15 @@ pre-commit install git add . git commit -m "Added awesome feature" # DONT'T WORRY IF ERRORS ARE RAISED. -# YOUR CODE IS NOT COMPLIANT WITH FLAKE8 or BLACK +# YOUR CODE IS NOT COMPLIANT WITH flake8, isort or black # Fix any flake8 errors by following their suggestions -# black will automatically format the files so they might look different, but you'll need to stage the files again for committing +# isort and black will automatically format the files so they might look different, but you'll need to stage the files +# again for committing # After fixing any flake8 errors git add . git commit -m "Added feature" ``` - -#### Run lint checking -```bash -flake8 ignite/ tests/ examples/ -``` - #### Run tests: To run a specific test, for example `test_terminate` from `test_engine.py` diff --git a/docs/source/about.rst b/docs/source/about.rst index b6c62873c807..a5f696b7b12f 100644 --- a/docs/source/about.rst +++ b/docs/source/about.rst @@ -28,7 +28,6 @@ The following people are currently core contributors to PyTorch-Ignite’s devel - Victor Fomin `@vfdev-5 `_ - Anmol Joshi `@anmolsjoshi `_ - Sylvain Desroziers `@sdesrozis `_ -- Elijah Rippeth `@erip `_ Emeritus Core Developers @@ -45,7 +44,8 @@ Join Core Team We are looking for motivated contributors to become collaborators and help out with the project. We can start considering a candidate after several successfully merged Github pull requests. -If you are interested, for more details, please, contact Victor (@vfdev-5) on `PyTorch Slack `_ or via email `vfdev.5` at `gmail.com`. +If you are interested, for more details, please, contact Victor (@vfdev-5) on `PyTorch Slack `_ +or via email `vfdev.5` at `gmail.com`. Citing PyTorch-Ignite @@ -56,7 +56,7 @@ If you use pytorch-ignite in a scientific publication, we would appreciate citat .. code-block:: text @misc{pytorch-ignite, - author = {V. Fomin, J. Anmol, S. Desroziers, J. Kriss, A. Tejani and E. Rippeth}, + author = {V. Fomin, J. Anmol, S. Desroziers, J. Kriss and A. Tejani}, title = {High-level library to help with training neural networks in PyTorch}, year = {2020}, publisher = {GitHub}, @@ -74,8 +74,8 @@ We are also grateful to Soumith Chintala `@soumith ` from Facebook for their help and to `PyTorch group `_ for infrastructure support (GPU CI and hosting of conda releases and our documentation). -In particular, Victor Fomin `@vfdev-5 `_ acknowledges `Magellium `_ for supporting project's development. - +In particular, Victor Fomin `@vfdev-5 `_ acknowledges `Magellium `_ +and `Quansight `_ for supporting project's development. We also acknowledge `scikit-learn project `_'s documentation on governance, author's presentation etc from which this project is highly inspired.