Skip to content

Commit

Permalink
tolerate pip 19.3 for --pyprof builds
Browse files Browse the repository at this point in the history
The 'main' function was moved between pip 19.2.3 and 19.3, which
causes '--pyprof' build to fail with (at least) pip 19.3 and 19.3.1:

    Traceback (most recent call last):
      File "setup.py", line 37, in <module>
        pipmain(["install"] + required_packages)
    TypeError: 'module' object is not callable

A permanent solution for this might require rewriting the '--pyprof'
install section to use 'python -m pip', but this change just adjusts
the import to tolerate the 19.3 change.

See:

- pypa/pip@09fd200
- pypa/pip#7498
- pypa/pip#7499
  • Loading branch information
hartb committed Jan 8, 2020
1 parent 0ce8ad3 commit 2e6d242
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import subprocess

from pip._internal import main as pipmain
if not callable(pipmain):
from pip._internal.main import main as pipmain

import sys
import warnings
import os
Expand Down

0 comments on commit 2e6d242

Please sign in to comment.