2

I am aware of this popular topic, however I am running into a different outcome when installing a python app using pip with git+https and python setup.py

I am building a docker image. I am trying to install in an image containing several other python apps, this custom webhook.

  1. Using git+https
RUN /venv/bin/pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/sentry

This seems to install the webhook the right way, as the relevant endpoint is l8r discoverable. What is more, when I exec into the running container and doing a search for relevant files, I see the following

./venv/lib/python3.7/site-packages/sentry_sdk
./venv/lib/python3.7/site-packages/__pycache__/alerta_sentry.cpython-37.pyc
./venv/lib/python3.7/site-packages/sentry_sdk-0.15.1.dist-info
./venv/lib/python3.7/site-packages/alerta_sentry.py
./venv/lib/python3.7/site-packages/alerta_sentry-5.0.0-py3.7.egg-info
  1. In my second approach I just copy this directory locally and in my Dockerfile I do
COPY sentry /app/sentry
RUN /venv/bin/python /app/sentry/setup.py install

This does not install the webhook appropriately and what is more, in the respective container I see a different file layout

./venv/lib/python3.7/site-packages/sentry_sdk
./venv/lib/python3.7/site-packages/sentry_sdk-0.15.1.dist-info
./venv/lib/python3.7/site-packages/alerta_sentry-5.0.0-py3.7.egg
./alerta_sentry.egg-info
./dist/alerta_sentry-5.0.0-py3.7.egg

(the sentry_sdk - related files must be irrelevant)

Why does the second approach fail to install the webhook appropriately?

Should these two option yield the same result?

pkaramol
  • 16,451
  • 43
  • 149
  • 324
  • "*Should these two option yield the same result?*" No, why? The 1st link in your question explains the difference and even after reading the answers there you still expect them to be equivalent? Why? – phd Aug 25 '20 at 00:12

1 Answers1

0

What finally worked is the following

RUN /venv/bin/pip install /app/sentry/

I don't know the subtle differences between these two installation modes

I did notice however that /venv/bin/python /app/sentry/setup.py install did not produce an alerta_sentry.py but only the .egg file, i.e. ./venv/lib/python3.7/site-packages/alerta_sentry-5.0.0-py3.7.egg

On the other hand, /venv/bin/pip install /app/sentry/ unpacked (?) the .egg creating the ./venv/lib/python3.7/site-packages/alerta_sentry.py

I don't also know why the second installation option (i.e. the one creating the .egg file) was not working run time.

pkaramol
  • 16,451
  • 43
  • 149
  • 324