wolever / pip2pi

pip2pi builds a PyPI-compatible package repository from pip requirements
Other
755 stars 96 forks source link

run without *building* packages #78

Open glensc opened 6 years ago

glensc commented 6 years ago

the project readme does not indicate any way that underneath the implementation actually builds and installs the packages.

this means for the command to succeed, i need to install various -dev packages

for example i was looking for this project, to speed up docker builds, using multistage builds.

FROM debian:stretch
RUN apt-get update
RUN apt-get install -y --no-install-recommends python3-pip python3-setuptools
RUN pip3 install pip2pi
RUN pip2tgz packages/ tesserocr==2.3.0
RUN dir2pi packages/

this fails with

root@dind docker/w# docker build -t pip2pi:1 .
Sending build context to Docker daemon  35.33kB
Step 1/9 : FROM debian:stretch
 ---> 3bbb526d2608
Step 2/9 : COPY requirements.txt /usr/src/weblate/
 ---> Using cache
 ---> fafdfec54e56
Step 3/9 : RUN apt-get update
 ---> Using cache
 ---> 94348872497d
Step 4/9 : RUN apt-get install -y --no-install-recommends python3-pip
 ---> Using cache
 ---> 649d90c85c82
Step 5/9 : RUN pip3 install pip2pi
 ---> Using cache
 ---> 82b6573157ea
Step 6/9 : ENV VERSION 3.0.1
 ---> Using cache
 ---> e4256fa8b6f0
Step 7/9 : RUN apt-get install -y --no-install-recommends python3-setuptools
 ---> Using cache
 ---> d05874d08e84
Step 8/9 : RUN pip2tgz packages/ tesserocr==2.3.0
 ---> Running in 022e4f9ef3cd
DEPRECATION: pip install --download has been deprecated and will be removed in the future. Pip now has a download command that should be used instead.
Collecting tesserocr==2.3.0
  Downloading https://files.pythonhosted.org/packages/49/fc/f5d3ca8606566073919a5964118591734e91ee8e42adcc0cc8fcefc3953a/tesserocr-2.3.0.tar.gz (54kB)
  Saved /packages/tesserocr-2.3.0.tar.gz
...
Collecting tesserocr==2.3.0
  Downloading https://files.pythonhosted.org/packages/49/fc/f5d3ca8606566073919a5964118591734e91ee8e42adcc0cc8fcefc3953a/tesserocr-2.3.0.tar.gz (54kB)
  Saved /packages/tesserocr-2.3.0.tar.gz
    Complete output from command python setup.py egg_info:
    Failed to extract tesseract version from executable: [Errno 2] No such file or directory: 'tesseract'
    Supporting tesseract v3.04.00
...

    distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
...
glensc commented 6 years ago

seems to covered by this issue: https://github.com/wolever/pip2pi/issues/70

perhaps pip install --download should be replaced with pip download to solve this?

safiyat commented 6 years ago

Failed to extract tesseract version from executable: [Errno 2] No such file or directory: 'tesseract'

From this line, the error seems to be in the package itself than in pip2pi.

@glensc Can you please attach complete error log?

glensc commented 6 years ago

@safiyat the exact error message is irrelevant. please read the bugreport again what i requested.

the symptom is that the package names given are actually attempted to be installed. thus includes build and compile steps. those must be omitted. these are useless and break process because non-pure python packages will fail if -dev packages missing.

safiyat commented 6 years ago

I don't think pip2pi actually installs the packages. It extracts the requested package and then after reading its requirements, downloads those required packages.

python install --download was deprecated, and has been removed in 10.0.0 and above. It only downloads the required packages, and does not install them.

I am stumped though as to why it would want to run x86_64-linux-gnu-gcc.