-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Similar to ignoring sys.path (#10059) and os.environ manipulations above imports, I propose adding another exception for the widely used pytest.importorskip.
picking up on @ion-elgreco's #10059 (comment), it may make sense to allow warnings.filterwarnings interspersed between imports as well.
example code snippet from materialsproject/atomate2#993 where this came up repeatedly (would be nice to get rid off the many # noqa: E402):
from atomate2.openff.utils import counts_from_box_size, merge_specs_by_name_and_smiles
pytest.importorskip("openff.toolkit")
import openff.toolkit as tk # noqa: E402
from openff.interchange import Interchange # noqa: E402
from openff.toolkit.topology import Topology # noqa: E402
from openff.toolkit.topology.molecule import Molecule # noqa: E402Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule