File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 16
16
def _patch_dist_in_site_packages (virtualenv : VirtualEnvironment ) -> None :
17
17
# Since the tests are run from a virtualenv, and to avoid the "Will not
18
18
# install to the usersite because it will lack sys.path precedence..."
19
- # error: Monkey patch `pip._internal.req.req_install.dist_in_site_packages`
20
- # and `pip._internal.utils.misc.dist_in_site_packages`
21
- # so it's possible to install a conflicting distribution in the user site.
19
+ # error: Monkey patch the Distribution class so it's possible to install a
20
+ # conflicting distribution in the user site.
22
21
virtualenv .sitecustomize = textwrap .dedent (
23
22
"""
24
23
def dist_in_site_packages(dist):
25
24
return False
26
25
27
- from pip._internal.req import req_install
28
- from pip._internal.utils import misc
29
- req_install.dist_in_site_packages = dist_in_site_packages
30
- misc.dist_in_site_packages = dist_in_site_packages
26
+ from pip._internal.metadata.base import BaseDistribution
27
+ BaseDistribution.in_site_packages = property(dist_in_site_packages)
31
28
"""
32
29
)
33
30
Original file line number Diff line number Diff line change @@ -135,8 +135,8 @@ def patch_dist_in_site_packages(virtualenv: VirtualEnvironment) -> None:
135
135
def dist_in_site_packages(dist):
136
136
return False
137
137
138
- from pip._internal.utils import misc
139
- misc.dist_in_site_packages = dist_in_site_packages
138
+ from pip._internal.metadata.base import BaseDistribution
139
+ BaseDistribution.in_site_packages = property( dist_in_site_packages)
140
140
"""
141
141
)
142
142
You can’t perform that action at this time.
0 commit comments