projecthorus / horusdemodlib

High Altitude Balloon Telemetry Library
GNU Lesser General Public License v2.1
52 stars 26 forks source link

Docker image installs horusdemodlib from pypi instead of current source #146

Open kng opened 1 year ago

kng commented 1 year ago

The line 50 uses pip to install the python library, it will collect it from pypi. This is probably ok if a new release is available on pypi before building the new image.

Better solution is to build it from the local source, suggested change:

COPY . /usr/local/src/horusdemodlib
RUN pip install --system --no-cache-dir --prefer-binary /usr/local/src/horusdemodlib

pip freeze shows horusdemodlib @ file:///usr/local/src/horusdemodlib

The build seems to version it just fine

Processing /usr/local/src/horusdemodlib
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: crcmod<2.0,>=1.7 in /usr/lib/python3/dist-packages (from horusdemodlib==0.3.10) (1.7)
Requirement already satisfied: python-dateutil<3.0,>=2.8 in /usr/lib/python3/dist-packages (from horusdemodlib==0.3.10) (2.8.1)
Requirement already satisfied: numpy<2.0,>=1.17 in /usr/lib/python3/dist-packages (from horusdemodlib==0.3.10) (1.19.5)
Requirement already satisfied: requests<3.0.0,>=2.24.0 in /usr/lib/python3/dist-packages (from horusdemodlib==0.3.10) (2.25.1)
Building wheels for collected packages: horusdemodlib
  Building wheel for horusdemodlib (PEP 517): started
  Building wheel for horusdemodlib (PEP 517): finished with status 'done'
  Created wheel for horusdemodlib: filename=horusdemodlib-0.3.10-py3-none-any.whl size=42363 sha256=d713b145d40a1d7784f78e65d09b11ac379c633c7553eaf3bc144576dacdfa44
  Stored in directory: /tmp/pip-ephem-wheel-cache-8r1228e7/wheels/b9/62/59/d59eaae1a2718baa67e792decbb2b5bd19e66d70b01d9decba
Successfully built horusdemodlib
Installing collected packages: horusdemodlib
Successfully installed horusdemodlib-0.3.10