File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 2
2
ast-based parser to gather modules/package dependencies of a Python module.
3
3
Code adapted from the find-imports project, currently in graveyard archive.
4
4
"""
5
+ from __future__ import annotations
6
+
5
7
import ast
6
8
import os
7
9
import pkgutil
8
10
from collections import defaultdict
9
11
from itertools import chain , filterfalse
10
12
from pathlib import Path
11
- from typing import DefaultDict
12
13
13
14
from ._supported_packages import PACKAGE_RENAMES , PYODIDE_PACKAGES , STANDARD_LIBRARY
14
15
@@ -68,7 +69,7 @@ class FinderResult:
68
69
def __init__ (self ) -> None :
69
70
self ._packages : set [str ] = set ()
70
71
self ._locals : set [str ] = set ()
71
- self ._unsupported : DefaultDict [str , set ] = defaultdict (set )
72
+ self ._unsupported : defaultdict [str , set ] = defaultdict (set )
72
73
73
74
def add_package (self , pkg_name : str ) -> None :
74
75
self ._packages .add (pkg_name )
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ class Dependency:
25
25
This class is a general abstraction over both external and local module dependency."""
26
26
27
27
import_line : str # Import line to inject in code under test
28
- filename : str | None = None # filename: to be used for tmp local modules, i.e. paths
28
+ filename : str | None = (
29
+ None # filename: to be used for tmp local modules, i.e. paths
30
+ )
29
31
code : str | None = None # code in the tmp local modules
30
32
inject : str | None = None # any code to inject in code under test
31
33
You can’t perform that action at this time.
0 commit comments