Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Fixed for Python 3.6 / pip 9.0.1 on Mac OS X 10.13.
Browse files Browse the repository at this point in the history
There was some Mac-specific code in pip that was causing issues with the `get_platform` monkey patch.
  • Loading branch information
alexreg committed Dec 15, 2017
1 parent 18a37a2 commit 05ca1ae
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pip_custom_platform/pymonkey.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

def pymonkey_argparse(argv):
# We want to parse --platform out as early as possible so we can do patches
# based on it
Expand All @@ -6,9 +7,15 @@ def pymonkey_argparse(argv):
parser.add_argument('--platform')
return parser.parse_known_args(argv)


def pymonkey_patch(mod, args):
if mod.__name__ == 'distutils.util':
if mod.__name__ == 'distutils.sysconfig':
from pip_custom_platform.default_platform import get_platform_func
import sysconfig
sysconfig.get_platform = get_platform_func(args, sysconfig.get_platform)
elif mod.__name__ == 'distutils.util':
from pip_custom_platform.default_platform import get_platform_func
mod.get_platform = get_platform_func(args, mod.get_platform)
elif mod.__name__ == 'pip.pep425tags':
from pip_custom_platform.default_platform import get_platform_func
mod.get_platform = get_platform_func(args, mod.get_platform)
elif mod.__name__ in ('pip', 'pip._internal') and hasattr(mod, 'main'):
Expand Down

0 comments on commit 05ca1ae

Please sign in to comment.