Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip 19.3 breaks pip2pi 0.8.1 #94

Open
gary-jackson opened this issue Oct 15, 2019 · 5 comments · May be fixed by #95
Open

pip 19.3 breaks pip2pi 0.8.1 #94

gary-jackson opened this issue Oct 15, 2019 · 5 comments · May be fixed by #95

Comments

@gary-jackson
Copy link

gary-jackson commented Oct 15, 2019

The latest version of pip (19.3) breaks pip2pi:

$ pip2pi index six==1.12                                                                                      
Traceback (most recent call last):                                                                         
  File "/zzz/bin/pip2pi", line 8, in <module>                                                                                                                                             
    sys.exit(pip2pi())                                                                                     
  File "/zzz/lib/python3.7/site-packages/libpip2pi/commands.py", line 555, in pip2pi                                                                                                      
    res = pip2tgz(subcmd_argv)                                                                             
  File "/zzz/lib/python3.7/site-packages/libpip2pi/commands.py", line 90, in maintain_cwd_helper                                                                                          
    return f(*args, **kwargs)                                                                              
  File "/zzz/lib/python3.7/site-packages/libpip2pi/commands.py", line 440, in pip2tgz                                                                                                     
    pip_run_command(pip_download_command.split() + [outdir] + argv[2:])                                    
  File "/zzz/lib/python3.7/site-packages/libpip2pi/commands.py", line 184, in pip_run_command                                                                                             
    res = pip_main(pip_args)                                                                               
TypeError: 'module' object is not callable
$

For now, rolling back to pip 19.2.3 has fixed the problem.

@SuperSandro2000
Copy link

I can confirm this. Downgrading is not really an easy option for me.

@Julian
Copy link

Julian commented Nov 26, 2019

First time trying to run this and encountering this issue too -- considering pip's API isn't public, and that all a quick look at the code seems to suggest is that the implementation here assembles command line arguments, is there a reason that doesn't just get executed as a subprocess (and therefore use pip's public API)?

@mgarnica mgarnica linked a pull request Dec 6, 2019 that will close this issue
@mgarnica
Copy link

mgarnica commented Dec 6, 2019

I have created a PR that fixes this issue, this commit broke pip2pi pypa/pip@09fd200 as they moved the main function into a main module.

I'm guessing the issue with having a subprocess is that you'd have to know what the alias for pip is, it could be pip or pip3 or pip3.8 or probably pip could not have an alias on the system depending on how it was installed, just a wild guess.

@gary-jackson
Copy link
Author

This is probably the best way to call pip as a subprocess:

subprocess.check_call([sys.executable, "-m", "pip", "install", "moduleA", "moduleB"])

@jayvdb
Copy link

jayvdb commented Dec 10, 2019

Created #100 for a longer-term solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants