Commit 9f443ed2 authored by Jeremy Reizenstein's avatar Jeremy Reizenstein Committed by Facebook GitHub Bot
Browse files

isort->usort

Summary: Move from isort to usort now that usort supports sorting within lines.

Reviewed By: patricklabatut

Differential Revision: D35893280

fbshipit-source-id: 621c1cd285199d785408504430ee0bdf8683b21e
parent 9320100a
...@@ -46,7 +46,7 @@ outlined on that page and do not file a public issue. ...@@ -46,7 +46,7 @@ outlined on that page and do not file a public issue.
## Coding Style ## Coding Style
We follow these [python](http://google.github.io/styleguide/pyguide.html) and [C++](https://google.github.io/styleguide/cppguide.html) style guides. We follow these [python](http://google.github.io/styleguide/pyguide.html) and [C++](https://google.github.io/styleguide/cppguide.html) style guides.
For the linter to work, you will need to install `black`, `flake`, `isort` and `clang-format`, and For the linter to work, you will need to install `black`, `flake`, `usort` and `clang-format`, and
they need to be fairly up to date. they need to be fairly up to date.
## License ## License
......
...@@ -43,7 +43,7 @@ export CUB_HOME=$PWD/cub-1.10.0 ...@@ -43,7 +43,7 @@ export CUB_HOME=$PWD/cub-1.10.0
For developing on top of PyTorch3D or contributing, you will need to run the linter and tests. If you want to run any of the notebook tutorials as `docs/tutorials` or the examples in `docs/examples` you will also need matplotlib and OpenCV. For developing on top of PyTorch3D or contributing, you will need to run the linter and tests. If you want to run any of the notebook tutorials as `docs/tutorials` or the examples in `docs/examples` you will also need matplotlib and OpenCV.
- scikit-image - scikit-image
- black - black
- isort - usort
- flake8 - flake8
- matplotlib - matplotlib
- tdqm - tdqm
...@@ -59,7 +59,7 @@ conda install jupyter ...@@ -59,7 +59,7 @@ conda install jupyter
pip install scikit-image matplotlib imageio plotly opencv-python pip install scikit-image matplotlib imageio plotly opencv-python
# Tests/Linting # Tests/Linting
pip install black 'isort<5' flake8 flake8-bugbear flake8-comprehensions pip install black usort flake8 flake8-bugbear flake8-comprehensions
``` ```
## Installing prebuilt binaries for PyTorch3D ## Installing prebuilt binaries for PyTorch3D
......
...@@ -22,8 +22,14 @@ ...@@ -22,8 +22,14 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIR=$(dirname "${DIR}") DIR=$(dirname "${DIR}")
echo "Running isort..." if [[ -f "${DIR}/tests/TARGETS" ]]
isort -y -sp "${DIR}" then
pyfmt "${DIR}"
else
# run usort externally only
echo "Running usort..."
usort "${DIR}"
fi
echo "Running black..." echo "Running black..."
black "${DIR}" black "${DIR}"
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# fmt: off # fmt: off
# flake8: noqa # flake8: noqa
'''Pytorch implementations of hyper-network modules. '''Pytorch implementations of hyper-network modules.
isort:skip_file
''' '''
import functools import functools
import torch import torch
import torch.nn as nn import torch.nn as nn
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# fmt: off # fmt: off
# flake8: noqa # flake8: noqa
'''A number of custom pytorch modules with sane defaults that I find useful for model prototyping. '''A number of custom pytorch modules with sane defaults that I find useful for model prototyping.
isort:skip_file
''' '''
import torch import torch
import torch.nn as nn import torch.nn as nn
......
...@@ -144,7 +144,7 @@ setup( ...@@ -144,7 +144,7 @@ setup(
install_requires=["fvcore", "iopath"], install_requires=["fvcore", "iopath"],
extras_require={ extras_require={
"all": ["matplotlib", "tqdm>4.29.0", "imageio", "ipywidgets"], "all": ["matplotlib", "tqdm>4.29.0", "imageio", "ipywidgets"],
"dev": ["flake8", "isort", "black==19.3b0"], "dev": ["flake8", "usort", "black==19.3b0"],
"implicitron": ["hydra-core>=1.1", "visdom", "lpips", "matplotlib"], "implicitron": ["hydra-core>=1.1", "visdom", "lpips", "matplotlib"],
}, },
entry_points={ entry_points={
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment