Skip to content

Commit 9f443ed

Browse files
bottlerfacebook-github-bot
authored andcommitted
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
1 parent 9320100 commit 9f443ed

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ outlined on that page and do not file a public issue.
4646
## Coding Style
4747
We follow these [python](http://google.github.io/styleguide/pyguide.html) and [C++](https://google.github.io/styleguide/cppguide.html) style guides.
4848
49-
For the linter to work, you will need to install `black`, `flake`, `isort` and `clang-format`, and
49+
For the linter to work, you will need to install `black`, `flake`, `usort` and `clang-format`, and
5050
they need to be fairly up to date.
5151
5252
## License

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export CUB_HOME=$PWD/cub-1.10.0
4343
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.
4444
- scikit-image
4545
- black
46-
- isort
46+
- usort
4747
- flake8
4848
- matplotlib
4949
- tdqm
@@ -59,7 +59,7 @@ conda install jupyter
5959
pip install scikit-image matplotlib imageio plotly opencv-python
6060
6161
# Tests/Linting
62-
pip install black 'isort<5' flake8 flake8-bugbear flake8-comprehensions
62+
pip install black usort flake8 flake8-bugbear flake8-comprehensions
6363
```
6464

6565
## Installing prebuilt binaries for PyTorch3D

dev/linter.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
2323
DIR=$(dirname "${DIR}")
2424

25-
echo "Running isort..."
26-
isort -y -sp "${DIR}"
25+
if [[ -f "${DIR}/tests/TARGETS" ]]
26+
then
27+
pyfmt "${DIR}"
28+
else
29+
# run usort externally only
30+
echo "Running usort..."
31+
usort "${DIR}"
32+
fi
2733

2834
echo "Running black..."
2935
black "${DIR}"

pytorch3d/implicitron/third_party/hyperlayers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# fmt: off
33
# flake8: noqa
44
'''Pytorch implementations of hyper-network modules.
5-
isort:skip_file
65
'''
76
import functools
7+
88
import torch
99
import torch.nn as nn
1010

pytorch3d/implicitron/third_party/pytorch_prototyping.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# fmt: off
33
# flake8: noqa
44
'''A number of custom pytorch modules with sane defaults that I find useful for model prototyping.
5-
isort:skip_file
65
'''
76
import torch
87
import torch.nn as nn

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def __init__(self, *args, **kwargs):
144144
install_requires=["fvcore", "iopath"],
145145
extras_require={
146146
"all": ["matplotlib", "tqdm>4.29.0", "imageio", "ipywidgets"],
147-
"dev": ["flake8", "isort", "black==19.3b0"],
147+
"dev": ["flake8", "usort", "black==19.3b0"],
148148
"implicitron": ["hydra-core>=1.1", "visdom", "lpips", "matplotlib"],
149149
},
150150
entry_points={

0 commit comments

Comments
 (0)