diff --git a/modulegraph2/__init__.py b/modulegraph2/__init__.py index 0e63107..3eab202 100644 --- a/modulegraph2/__init__.py +++ b/modulegraph2/__init__.py @@ -11,6 +11,7 @@ This module provides annotation for use with `Mypy `_. """ + __version__ = "2.3" from ._depinfo import DependencyInfo diff --git a/modulegraph2/__main__.py b/modulegraph2/__main__.py index 0cf2f4f..e5001e6 100644 --- a/modulegraph2/__main__.py +++ b/modulegraph2/__main__.py @@ -1,6 +1,7 @@ """ Commandline interface """ + import argparse import enum import functools diff --git a/modulegraph2/_ast_tools.py b/modulegraph2/_ast_tools.py index 271fbd1..899073d 100644 --- a/modulegraph2/_ast_tools.py +++ b/modulegraph2/_ast_tools.py @@ -2,6 +2,7 @@ Tools for working with the AST for a module. This currently just defines a function for extracting information about import statements from the AST. """ + import ast import collections from typing import Deque, Iterator, Tuple diff --git a/modulegraph2/_bytecode_tools.py b/modulegraph2/_bytecode_tools.py index 2c4c200..d714e0c 100644 --- a/modulegraph2/_bytecode_tools.py +++ b/modulegraph2/_bytecode_tools.py @@ -3,6 +3,7 @@ defines a function for extracting information about import statements and the use of global names. """ + import collections import dis import sys diff --git a/modulegraph2/_distributions.py b/modulegraph2/_distributions.py index b416bc4..2537451 100644 --- a/modulegraph2/_distributions.py +++ b/modulegraph2/_distributions.py @@ -3,6 +3,7 @@ to process information about package distributions (the stuff on PyPI). """ + import dataclasses import os import sys diff --git a/modulegraph2/_dotbuilder.py b/modulegraph2/_dotbuilder.py index af2a4ca..fa44811 100644 --- a/modulegraph2/_dotbuilder.py +++ b/modulegraph2/_dotbuilder.py @@ -6,6 +6,7 @@ a generic version of this module will be added to the objectgraph package, with modulegraph2 specific functionality in this module. """ + from typing import Callable, Dict, Iterator, Sequence, Set, TextIO, Tuple, Union from objectgraph import EDGE_TYPE, NODE_TYPE # , ObjectGraph diff --git a/modulegraph2/_graphbuilder.py b/modulegraph2/_graphbuilder.py index fe84557..673fa8d 100644 --- a/modulegraph2/_graphbuilder.py +++ b/modulegraph2/_graphbuilder.py @@ -1,6 +1,7 @@ """ Tools for building the module graph """ + import ast import importlib import importlib.abc @@ -184,9 +185,11 @@ def node_for_spec( loader=loader, distribution=None, extension_attributes={}, - filename=pathlib.Path(adjust_path(spec.origin)) - if spec.origin is not None - else None, + filename=( + pathlib.Path(adjust_path(spec.origin)) + if spec.origin is not None + else None + ), search_path=[pathlib.Path(loc) for loc in search_path], has_data_files=False, ) @@ -209,13 +212,17 @@ def node_for_spec( node = ExtensionModule( name=spec.name, loader=loader, - distribution=distribution_for_file(spec.origin, path) - if spec.origin is not None - else None, + distribution=( + distribution_for_file(spec.origin, path) + if spec.origin is not None + else None + ), extension_attributes={}, - filename=pathlib.Path(adjust_path(spec.origin)) - if spec.origin is not None - else None, + filename=( + pathlib.Path(adjust_path(spec.origin)) + if spec.origin is not None + else None + ), globals_read=set(), globals_written=set(), code=None, @@ -323,9 +330,11 @@ def node_for_spec( init_module=FrozenModule( name="@@SIX_MOVES@@", loader=loader, - distribution=distribution_for_file(spec.origin, path) - if spec.origin is not None - else None, + distribution=( + distribution_for_file(spec.origin, path) + if spec.origin is not None + else None + ), extension_attributes={}, filename=None, globals_written=set(SIX_MOVES_GLOBALS), diff --git a/modulegraph2/_htmlbuilder.py b/modulegraph2/_htmlbuilder.py index 2f78951..2caf3c7 100644 --- a/modulegraph2/_htmlbuilder.py +++ b/modulegraph2/_htmlbuilder.py @@ -6,6 +6,7 @@ a generic version of this module will be added to the objectgraph package, with modulegraph2 specific functionality in this module. """ + import operator import textwrap from typing import TextIO diff --git a/modulegraph2/_implies.py b/modulegraph2/_implies.py index 59a6885..0e11f09 100644 --- a/modulegraph2/_implies.py +++ b/modulegraph2/_implies.py @@ -5,7 +5,6 @@ inspection of the stdlib sources for CPython. """ - import os import sys from typing import Dict, Sequence, Tuple, Union diff --git a/modulegraph2/_modulegraph.py b/modulegraph2/_modulegraph.py index 77e15ce..5903170 100644 --- a/modulegraph2/_modulegraph.py +++ b/modulegraph2/_modulegraph.py @@ -1,6 +1,7 @@ """ This module contains the definition of the ModuleGraph class. """ + import ast import contextlib import importlib diff --git a/modulegraph2/_mypyc_support.py b/modulegraph2/_mypyc_support.py index 39c0786..2f15688 100644 --- a/modulegraph2/_mypyc_support.py +++ b/modulegraph2/_mypyc_support.py @@ -2,6 +2,7 @@ Support code that deals with packages compiled with mypyc. """ + import ast import modulegraph2 diff --git a/modulegraph2/_swig_support.py b/modulegraph2/_swig_support.py index 3f07a60..abd06e0 100644 --- a/modulegraph2/_swig_support.py +++ b/modulegraph2/_swig_support.py @@ -1,6 +1,7 @@ """ Support code that deals with SWIG. """ + import importlib.util import os import sys diff --git a/modulegraph2/_utilities.py b/modulegraph2/_utilities.py index 63fbdfa..a2eb128 100644 --- a/modulegraph2/_utilities.py +++ b/modulegraph2/_utilities.py @@ -1,6 +1,7 @@ """ Some useful utility functions. """ + import contextlib import importlib import pathlib diff --git a/modulegraph2/_virtualenv_support.py b/modulegraph2/_virtualenv_support.py index 1ded66c..c40461e 100644 --- a/modulegraph2/_virtualenv_support.py +++ b/modulegraph2/_virtualenv_support.py @@ -10,6 +10,7 @@ trigger because the environment is build on top of the stdlib "venv" library. """ + import os import sys diff --git a/testsuite/util.py b/testsuite/util.py index 4a3d270..32f05dc 100644 --- a/testsuite/util.py +++ b/testsuite/util.py @@ -1,6 +1,7 @@ """ Testing utilities """ + import importlib import os import sys