Unverified Commit ea9876e3 authored by msbaines's avatar msbaines Committed by GitHub
Browse files

[chore] update isort to 5.6.4 (#170)

parent 2108f20e
...@@ -148,7 +148,7 @@ jobs: ...@@ -148,7 +148,7 @@ jobs:
- run: - run:
name: Run Linter (isort) name: Run Linter (isort)
command: | command: |
isort --check-only isort . --check
- run: - run:
name: Run Linter (black) name: Run Linter (black)
...@@ -245,6 +245,10 @@ jobs: ...@@ -245,6 +245,10 @@ jobs:
- run: nvidia-smi - run: nvidia-smi
- run: pyenv uninstall -f 3.7.0
- run: pyenv install 3.7.0
- run: pyenv global 3.7.0 - run: pyenv global 3.7.0
- <<: *setup_venv - <<: *setup_venv
...@@ -252,14 +256,14 @@ jobs: ...@@ -252,14 +256,14 @@ jobs:
# Cache the venv directory that contains dependencies # Cache the venv directory that contains dependencies
- restore_cache: - restore_cache:
keys: keys:
- cache-key-gpu16-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}} - cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
- <<: *install_dep_16 - <<: *install_dep_16
- save_cache: - save_cache:
paths: paths:
- ~/venv - ~/venv
key: cache-key-gpu16-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}} key: cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
- <<: *install_repo_gpu - <<: *install_repo_gpu
......
...@@ -33,8 +33,8 @@ repos: ...@@ -33,8 +33,8 @@ repos:
- id: seed-isort-config - id: seed-isort-config
language_version: python3.6 language_version: python3.6
- repo: https://github.com/timothycrosley/isort - repo: https://github.com/pycqa/isort
rev: 4.3.20 rev: 5.6.4
hooks: hooks:
- id: isort - id: isort
exclude: README.md exclude: README.md
......
...@@ -188,8 +188,8 @@ def make_model(args, device, ntokens): ...@@ -188,8 +188,8 @@ def make_model(args, device, ntokens):
def get_tensors_by_size_bucket(): def get_tensors_by_size_bucket():
import gc
from collections import defaultdict from collections import defaultdict
import gc
size_buckets = defaultdict(int) size_buckets = defaultdict(int)
for obj in gc.get_objects(): for obj in gc.get_objects():
...@@ -202,8 +202,8 @@ def get_tensors_by_size_bucket(): ...@@ -202,8 +202,8 @@ def get_tensors_by_size_bucket():
def dump_size_buckets(size_buckets, prefix=""): def dump_size_buckets(size_buckets, prefix=""):
import operator
from functools import reduce from functools import reduce
import operator
total = 0 total = 0
for key, value in size_buckets.items(): for key, value in size_buckets.items():
...@@ -247,8 +247,8 @@ def check_size_buckets(): ...@@ -247,8 +247,8 @@ def check_size_buckets():
def dump_cuda_tensors(): def dump_cuda_tensors():
print(f"dumping cuda tensors...") print(f"dumping cuda tensors...")
from functools import reduce from functools import reduce
import operator
import gc import gc
import operator
for obj in gc.get_objects(): for obj in gc.get_objects():
if not isinstance(obj, torch.Tensor): if not isinstance(obj, torch.Tensor):
......
...@@ -20,4 +20,12 @@ exclude = ''' ...@@ -20,4 +20,12 @@ exclude = '''
''' '''
[tool.isort] [tool.isort]
known_third_party = "benchmark_dataset,dataclasses,numpy,packaging,pytest,recommonmark,setuptools,torch,torchtext,torchvision" line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
skip_glob = ["build/*", "stubs/*"]
# Don't split "import" and "from".
force_sort_within_sections = true
known_third_party = ["benchmark_dataset", "dataclasses", "numpy", "packaging", "pytest", "recommonmark", "setuptools", "torch", "torchtext", "torchvision"]
black == 19.10b0 black == 19.10b0
flake8 == 3.7.9 flake8 == 3.7.9
isort == 4.3.21 isort == 5.6.4
mpi4py == 3.0.3 mpi4py == 3.0.3
mypy == 0.770 mypy == 0.770
pytest == 5.4.1 pytest == 5.4.1
......
...@@ -34,21 +34,6 @@ ignore = ...@@ -34,21 +34,6 @@ ignore =
per-file-ignores = __init__.py: F401 per-file-ignores = __init__.py: F401
exclude = build,*.pyi,.git exclude = build,*.pyi,.git
# -----------------------------------------------------------------------------
# isort
# -----------------------------------------------------------------------------
[isort]
line_length = 120
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
skip_glob = build/*,stubs/*
# Don't split "import" and "from".
force_sort_within_sections = true
known_third_party = pytest,setuptools,torch,torchtext
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# mypy # mypy
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
......
...@@ -10,7 +10,7 @@ import pytest ...@@ -10,7 +10,7 @@ import pytest
import torch import torch
try: try:
from fairscale.optim import Adam, Precision, GradScaler from fairscale.optim import Adam, GradScaler, Precision
imported_adam = True imported_adam = True
except ImportError: except ImportError:
......
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