Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 14, 2024
1 parent 4e47331 commit c75e0d1
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 13 deletions.
1 change: 1 addition & 0 deletions modulegraph2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
This module provides annotation for use with
`Mypy <https://mypy.readthedocs.io/en/latest/>`_.
"""

__version__ = "2.3"

from ._depinfo import DependencyInfo
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Commandline interface
"""

import argparse
import enum
import functools
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_ast_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_bytecode_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
to process information about package distributions (the
stuff on PyPI).
"""

import dataclasses
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_dotbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 21 additions & 12 deletions modulegraph2/_graphbuilder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tools for building the module graph
"""

import ast
import importlib
import importlib.abc
Expand Down Expand Up @@ -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,
)
Expand All @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_htmlbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion modulegraph2/_implies.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
inspection of the stdlib sources for CPython.
"""


import os
import sys
from typing import Dict, Sequence, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_modulegraph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the definition of the ModuleGraph class.
"""

import ast
import contextlib
import importlib
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_mypyc_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Support code that deals with packages compiled
with mypyc.
"""

import ast

import modulegraph2
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_swig_support.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Support code that deals with SWIG.
"""

import importlib.util
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_utilities.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Some useful utility functions.
"""

import contextlib
import importlib
import pathlib
Expand Down
1 change: 1 addition & 0 deletions modulegraph2/_virtualenv_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
trigger because the environment is build on top
of the stdlib "venv" library.
"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions testsuite/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Testing utilities
"""

import importlib
import os
import sys
Expand Down

0 comments on commit c75e0d1

Please sign in to comment.