Skip to content

Commit

Permalink
upgrade isort v5.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vporta authored and omry committed Sep 23, 2020
1 parent bb93b58 commit 16b2f26
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 24 deletions.
18 changes: 14 additions & 4 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
[settings]
multi_line_output=3
include_trailing_comma=True
include_trailing_comma=true
force_grid_wrap=0
use_parentheses=True
line_length=88
ensure_newline_before_comments=True
known_third_party=omegaconf,ray,pytest,typing_extensions
known_first_party=hydra
ensure_newline_before_comments=true
known_libs=pkg_resources,setuptools
sections=
FUTURE
STDLIB
LIBS
THIRDPARTY
FIRSTPARTY
LOCALFOLDER
default_section=THIRDPARTY
known_first_party=hydra,hydra_app
skip=
plugins
,tools
,.nox
,hydra/grammar/gen
,tools/configen/example/gen
,tools/configen/tests/test_modules/expected

9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
repos:
- repo: https://github.com/timothycrosley/isort
rev: 'c54b3dd'
- repo: https://github.com/pycqa/isort
rev: 5.5.2
hooks:
- id: isort
files: 'hydra/.*'
- id: isort
files: 'plugins/.*'
- id: isort
files: 'tools/.*'

- repo: https://github.com/psf/black
rev: 20.8b1
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def lint(session):
".git",
"website",
"plugins",
"tools",
".nox",
"hydra/grammar/gen",
"tools/configen/example/gen",
Expand Down
16 changes: 12 additions & 4 deletions plugins/.isort.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
[settings]
multi_line_output=3
include_trailing_comma=True
include_trailing_comma=true
force_grid_wrap=0
use_parentheses=True
use_parentheses=true
line_length=88
ensure_newline_before_comments=True
known_third_party=hydra,omegaconf
ensure_newline_before_comments=true
float_to_top=true
sections=
FUTURE
STDLIB
THIRDPARTY
FIRSTPARTY
LOCALFOLDER
default_section=THIRDPARTY
known_first_party=hydra_plugins

2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ black==20.8b1
coverage
flake8
flake8-copyright
isort@git+git://github.com/timothycrosley/isort.git@c54b3dd#egg=isort
isort==5.5.2
mypy
nox
packaging
Expand Down
17 changes: 17 additions & 0 deletions tools/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[settings]
multi_line_output=3
include_trailing_comma=true
force_grid_wrap=0
use_parentheses=true
line_length=88
ensure_newline_before_comments=true
float_to_top=true
sections=
FUTURE
STDLIB
THIRDPARTY
FIRSTPARTY
LOCALFOLDER
default_section=THIRDPARTY
known_first_party=tools

3 changes: 1 addition & 2 deletions tools/configen/configen/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
from dataclasses import dataclass
from typing import List, Optional

from omegaconf import MISSING

from hydra.core.config_store import ConfigStore
from omegaconf import MISSING


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion tools/configen/configen/configen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pathlib import Path
from typing import Any, Dict, List, Optional, Set, Type

import hydra
from jinja2 import Environment, PackageLoader, Template
from omegaconf import OmegaConf, ValidationError
from omegaconf._utils import (
Expand All @@ -19,7 +20,6 @@
is_structured_config,
)

import hydra
from configen.config import Config, ConfigenConf, ModuleConf
from configen.utils import (
collect_imports,
Expand Down
2 changes: 2 additions & 0 deletions tools/configen/configen/samples/my_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved


class User:
def __init__(self, age: int, name: str):
self.age = age
Expand Down
9 changes: 4 additions & 5 deletions tools/configen/example/my_app.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from omegaconf import DictConfig

import hydra

# Underlying objects
from configen.samples.my_module import Admin, User

# Generated config dataclasses
from example.config.configen.samples.my_module import AdminConf, UserConf
from hydra.core.config_store import ConfigStore
from omegaconf import DictConfig

# Underlying objects
from configen.samples.my_module import Admin, User

ConfigStore.instance().store(
name="config",
Expand Down
1 change: 0 additions & 1 deletion tools/configen/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved

from setuptools import find_packages, setup

setup(
Expand Down
7 changes: 3 additions & 4 deletions tools/release/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
from pathlib import Path
from typing import List, Tuple

import requests
from omegaconf import MISSING, DictConfig, OmegaConf
from packaging.version import Version, parse

import hydra
import requests
from hydra.core.config_store import ConfigStore
from hydra.test_utils.test_utils import find_parent_dir_containing, get_run_output
from omegaconf import MISSING, DictConfig, OmegaConf
from packaging.version import Version, parse

log = logging.getLogger(__name__)
HYDRA_ROOT = find_parent_dir_containing(target="ATTRIBUTION")
Expand Down

0 comments on commit 16b2f26

Please sign in to comment.