mitsuhiko / platter

A useful helper for wheel deployments.
Other
335 stars 52 forks source link

How to install builds without cloning vcs dependencies again? #33

Open bcho opened 9 years ago

bcho commented 9 years ago

In my requirements.txt, I have a vcs dependency like:

git+https://github.com/some_one/repo.git#egg=repo-0.0.1

Platter can build this dependency into a wheel, but during the install step, it will clone this repo again.

How can I make pip install this dependency from wheel instead of cloning from vcs?

RussellLuo commented 9 years ago

I encountered this problem too.

After diving into the source code of platter, I found the reason:

  1. If you specify -r requirements.txt when building, platter will copy the requirements.txt file into the data directory of the final distribution. See code here,
  2. In installation stage, if there is a requirements.txt file in the data directory of the distribution, platter will automatically add -r requirements.txt option to intall it. See code here

This may be a deliberately designed feature, but I didn't catch the intention. I even think it goes against the main purpose of platter, which aids in creating packages that can install without compiling or downloading on servers.

RussellLuo commented 9 years ago

After reading the pip documentation, I realized that this behavior for adding -r requirements.txt option is correct. It's the pip's issue, not platter's.

I have opened an issue at pip, see what will happen next.

bcho commented 9 years ago

@RussellLuo A quick & dirty solution is to rewrite all vcs deps in the requirements.txt after building the wheel.

RussellLuo commented 9 years ago

Yeah, that's an obvious solution. But I think it's more elegant to install all wheels directly like this:

$ pip install $(ls /local/wheels/*.whl)

Until pip provides a more standard solution, I'll use this one.