Skip to content

Commit 3c138a4

Browse files
authored
Fix flake8 F401 imported but unused (huggingface#317)
* Fix flake8 F401 '...' imported but unused * One more F403
1 parent 2fa4476 commit 3c138a4

File tree

6 files changed

+4
-22
lines changed

6 files changed

+4
-22
lines changed

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ use_parentheses = True
1717
[flake8]
1818
ignore = E203, E722, E501, E741, W503, W605
1919
max-line-length = 119
20+
per-file-ignores = __init__.py:F401

src/diffusers/__init__.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# flake8: noqa
2-
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3-
# module, but to preserve other warnings. So, don't check this module at all.
41
from .utils import is_inflect_available, is_scipy_available, is_transformers_available, is_unidecode_available
52

63

@@ -32,7 +29,7 @@
3229
if is_scipy_available():
3330
from .schedulers import LMSDiscreteScheduler
3431
else:
35-
from .utils.dummy_scipy_objects import *
32+
from .utils.dummy_scipy_objects import * # noqa F403
3633

3734
from .training_utils import EMAModel
3835

@@ -45,4 +42,4 @@
4542
StableDiffusionPipeline,
4643
)
4744
else:
48-
from .utils.dummy_transformers_objects import *
45+
from .utils.dummy_transformers_objects import * # noqa F403

src/diffusers/models/__init__.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# flake8: noqa
2-
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3-
# module, but to preserve other warnings. So, don't check this module at all.
4-
51
# Copyright 2022 The HuggingFace Team. All rights reserved.
62
#
73
# Licensed under the Apache License, Version 2.0 (the "License");

src/diffusers/pipelines/__init__.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# flake8: noqa
2-
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3-
# module, but to preserve other warnings. So, don't check this module at all.
4-
51
from ..utils import is_transformers_available
62
from .ddim import DDIMPipeline
73
from .ddpm import DDPMPipeline

src/diffusers/schedulers/__init__.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# flake8: noqa
2-
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3-
# module, but to preserve other warnings. So, don't check this module at all.
4-
51
# Copyright 2022 The HuggingFace Team. All rights reserved.
62
#
73
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,4 +25,4 @@
2925
if is_scipy_available():
3026
from .scheduling_lms_discrete import LMSDiscreteScheduler
3127
else:
32-
from ..utils.dummy_scipy_objects import *
28+
from ..utils.dummy_scipy_objects import * # noqa F403

src/diffusers/utils/__init__.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# flake8: noqa
2-
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3-
# module, but to preserve other warnings. So, don't check this module at all.
4-
51
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
62
#
73
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)