9
9
"dockerpty" , # Not supported on windows
10
10
"adodbapi" , # Not needed by users
11
11
"black" , # Not needed by users
12
+ # importing pip overwrites distutils in sys.modules
13
+ # with a copy of setuptools instead, which then breaks
14
+ # any packages that depend on distutils directly.
15
+ # https://github.com/pypa/pip/issues/8761
16
+ #
17
+ # Importing pip as a module in general is a bad idea (tm), so just don't do that.
18
+ #
19
+ # It's possible to use:
20
+ # >>> import _distutils_hack
21
+ # >>> _distutils_hack.remove_shim()
22
+ # >>> import pip
23
+ # if someone *really* needs to import pip (yes, seriously; no, it's not a good idea).
24
+ "pip" ,
12
25
}
13
26
14
27
@@ -17,7 +30,7 @@ class TestGeniePythonImports(unittest.TestCase):
17
30
Tests that modules which users use can be imported.
18
31
"""
19
32
20
- def _attempt_to_import_module_by_name (self , module_name ) :
33
+ def _attempt_to_import_module_by_name (self , module_name : str ) -> str | None :
21
34
"""
22
35
Attempts to import a module by name.
23
36
:param module_name: the module name to import
@@ -38,12 +51,13 @@ def _attempt_to_import_module_by_name(self, module_name):
38
51
else :
39
52
return None
40
53
41
- def test_WHEN_importing_all_installed_packages_THEN_no_error (self ):
54
+ def test_WHEN_importing_all_installed_packages_THEN_no_error (self ) -> None :
42
55
"""
43
56
This tests that all of the modules we've installed are importable as modules.
44
57
"""
45
58
46
- # Ignore warnings. We get lots of these from various modules and it's too noisy for this test suite.
59
+ # Ignore warnings. We get lots of these from various modules and it's too noisy for this
60
+ # test suite.
47
61
warnings .filterwarnings ("ignore" )
48
62
49
63
failures = []
0 commit comments