mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									9320100abc
								
							
						
					
					
						commit
						9f443ed26b
					
				
							
								
								
									
										2
									
								
								.github/CONTRIBUTING.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/CONTRIBUTING.md
									
									
									
									
										vendored
									
									
								
							@ -46,7 +46,7 @@ outlined on that page and do not file a public issue.
 | 
			
		||||
## Coding Style
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
@ -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.
 | 
			
		||||
- scikit-image
 | 
			
		||||
- black
 | 
			
		||||
- isort
 | 
			
		||||
- usort
 | 
			
		||||
- flake8
 | 
			
		||||
- matplotlib
 | 
			
		||||
- tdqm
 | 
			
		||||
@ -59,7 +59,7 @@ conda install jupyter
 | 
			
		||||
pip install scikit-image matplotlib imageio plotly opencv-python
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
 | 
			
		||||
@ -22,8 +22,14 @@
 | 
			
		||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 | 
			
		||||
DIR=$(dirname "${DIR}")
 | 
			
		||||
 | 
			
		||||
echo "Running isort..."
 | 
			
		||||
isort -y -sp "${DIR}"
 | 
			
		||||
if [[ -f "${DIR}/tests/TARGETS" ]]
 | 
			
		||||
then
 | 
			
		||||
  pyfmt "${DIR}"
 | 
			
		||||
else
 | 
			
		||||
# run usort externally only
 | 
			
		||||
  echo "Running usort..."
 | 
			
		||||
  usort  "${DIR}"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "Running black..."
 | 
			
		||||
black "${DIR}"
 | 
			
		||||
 | 
			
		||||
@ -2,9 +2,9 @@
 | 
			
		||||
# fmt: off
 | 
			
		||||
# flake8: noqa
 | 
			
		||||
'''Pytorch implementations of hyper-network modules.
 | 
			
		||||
isort:skip_file
 | 
			
		||||
'''
 | 
			
		||||
import functools
 | 
			
		||||
 | 
			
		||||
import torch
 | 
			
		||||
import torch.nn as nn
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,6 @@
 | 
			
		||||
# fmt: off
 | 
			
		||||
# flake8: noqa
 | 
			
		||||
'''A number of custom pytorch modules with sane defaults that I find useful for model prototyping.
 | 
			
		||||
isort:skip_file
 | 
			
		||||
'''
 | 
			
		||||
import torch
 | 
			
		||||
import torch.nn as nn
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
									
									
									
									
								
							@ -144,7 +144,7 @@ setup(
 | 
			
		||||
    install_requires=["fvcore", "iopath"],
 | 
			
		||||
    extras_require={
 | 
			
		||||
        "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"],
 | 
			
		||||
    },
 | 
			
		||||
    entry_points={
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user