Apply import formatting to files in the 2nd top level (#4717)
* Update pyproject.toml * Apply isort to files in second level Co-authored-by: chaton <thomas@grid.ai>
This commit is contained in:
parent
9a5d40aff4
commit
ece09f0c5f
|
@ -24,8 +24,31 @@ known_first_party = [
|
|||
]
|
||||
skip_glob = [
|
||||
"pl_examples/*",
|
||||
"pytorch_lightning/*",
|
||||
"tests/*"
|
||||
] # Only apply formatting on root-level scripts, docs and benchmarks
|
||||
"pytorch_lightning/accelerators/*",
|
||||
"pytorch_lightning/callbacks/*",
|
||||
"pytorch_lightning/cluster_environments/*",
|
||||
"pytorch_lightning/core/*",
|
||||
"pytorch_lightning/distributed/*",
|
||||
"pytorch_lightning/loggers/*",
|
||||
"pytorch_lightning/metrics/*",
|
||||
"pytorch_lightning/overrides/*",
|
||||
"pytorch_lightning/plugins/*",
|
||||
"pytorch_lightning/profiler/*",
|
||||
"pytorch_lightning/trainer/*",
|
||||
"pytorch_lightning/tuner/*",
|
||||
"pytorch_lightning/utilities/*",
|
||||
"tests/backends/*",
|
||||
"tests/base/*",
|
||||
"tests/callbacks/*",
|
||||
"tests/checkpointing/*",
|
||||
"tests/core/*",
|
||||
"tests/loggers/*",
|
||||
"tests/metrics/*",
|
||||
"tests/models/*",
|
||||
"tests/plugins/*",
|
||||
"tests/trainer/*",
|
||||
"tests/tuner/*",
|
||||
"tests/utilities/*",
|
||||
]
|
||||
profile = "black"
|
||||
line_length = 120
|
||||
|
|
|
@ -53,11 +53,11 @@ if __LIGHTNING_SETUP__:
|
|||
sys.stdout.write(f'Partial import of `{__name__}` during the build process.\n') # pragma: no-cover
|
||||
# We are not importing the rest of the lightning during the build process, as it may not be compiled yet
|
||||
else:
|
||||
from pytorch_lightning.core import LightningDataModule, LightningModule
|
||||
from pytorch_lightning import metrics
|
||||
from pytorch_lightning.callbacks import Callback
|
||||
from pytorch_lightning.core import LightningDataModule, LightningModule
|
||||
from pytorch_lightning.trainer import Trainer
|
||||
from pytorch_lightning.utilities.seed import seed_everything
|
||||
from pytorch_lightning import metrics
|
||||
|
||||
__all__ = [
|
||||
'Trainer',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import sys
|
||||
import threading
|
||||
from functools import wraps, partial
|
||||
from functools import partial, wraps
|
||||
from http.server import SimpleHTTPRequestHandler
|
||||
|
||||
import pytest
|
||||
|
@ -42,8 +42,8 @@ def tmpdir_server(tmpdir):
|
|||
return os.path.join(str(tmpdir), relpath)
|
||||
|
||||
# ThreadingHTTPServer was added in 3.7, so we need to define it ourselves
|
||||
from socketserver import ThreadingMixIn
|
||||
from http.server import HTTPServer
|
||||
from socketserver import ThreadingMixIn
|
||||
|
||||
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
|
||||
daemon_threads = True
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
"""Test deprecated functionality which will be removed in vX.Y.Z"""
|
||||
from argparse import ArgumentParser
|
||||
import pytest
|
||||
import sys
|
||||
from argparse import ArgumentParser
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from tests.base import EvalModelTemplate
|
||||
from pytorch_lightning.metrics.functional.classification import auc
|
||||
|
||||
from pytorch_lightning import Trainer
|
||||
from pytorch_lightning.callbacks import ModelCheckpoint
|
||||
from pytorch_lightning.metrics.functional.classification import auc
|
||||
from pytorch_lightning.profiler.profilers import PassThroughProfiler, SimpleProfiler
|
||||
from pytorch_lightning.utilities.exceptions import MisconfigurationException
|
||||
from tests.base import EvalModelTemplate
|
||||
|
||||
|
||||
def test_tbd_remove_in_v1_3_0(tmpdir):
|
||||
|
|
Loading…
Reference in New Issue