From cfa8b796f7fff01963b02fe51c6f7a0022cb8897 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 18 Aug 2024 12:01:17 -0700 Subject: [PATCH] cleanup dependencies (#2001) * cleanup dependencies * in the real spot * fix jenkins --- Dockerfile | 12 ++++++------ README.md | 2 +- requirements.txt | 18 ------------------ setup.py | 24 +++++++++++++++++++----- 4 files changed, 26 insertions(+), 30 deletions(-) delete mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 51a58ca803..5d3c1ffc1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,19 +20,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ rm -rf arm/ && \ rm -rf thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp -COPY requirements.txt /tmp/ -RUN pip3 install --break-system-packages --no-cache-dir -r /tmp/requirements.txt - ENV CPPCHECK_DIR=/tmp/cppcheck COPY tests/misra/install.sh /tmp/ RUN /tmp/install.sh && rm -rf $CPPCHECK_DIR/.git/ ENV SKIP_CPPCHECK_INSTALL=1 +COPY setup.py __init__.py $PYTHONPATH/panda/ +COPY python/__init__.py $PYTHONPATH/panda/python/ +RUN pip3 install --break-system-packages --no-cache-dir $PYTHONPATH/panda/[dev] + # TODO: this should be a "pip install" or not even in this repo at all RUN git config --global --add safe.directory $PYTHONPATH/panda ENV OPENDBC_REF="5ed7a834a4e0e24c3968dd1e98ceb4b9d5f9791a" -RUN mkdir -p $PYTHONPATH && \ - cd /tmp/ && \ +RUN cd /tmp/ && \ git clone --depth 1 https://github.com/commaai/opendbc opendbc_repo && \ cd opendbc_repo && git fetch origin $OPENDBC_REF && git checkout FETCH_HEAD && rm -rf .git/ && \ pip3 install --break-system-packages --no-cache-dir Cython numpy && \ @@ -41,5 +41,5 @@ RUN mkdir -p $PYTHONPATH && \ # for Jenkins COPY README.md panda.tar.* /tmp/ -RUN mkdir /tmp/pythonpath/panda && \ +RUN mkdir -p /tmp/pythonpath/panda && \ tar -xvf /tmp/panda.tar.gz -C /tmp/pythonpath/panda/ || true diff --git a/README.md b/README.md index dcef0c6439..618a5b70d6 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ git clone https://github.com/commaai/panda.git cd panda # install dependencies -pip install -r requirements.txt +pip install -e .[dev] # install panda python setup.py install diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 5ee8636fd5..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -ruff -libusb1 -numpy -hexdump -pycryptodome -tqdm>=4.14.0 -pytest -pytest-mock -pytest-xdist -pytest-timeout -pytest-randomly -parameterized -cffi -pre-commit -scons>=4.4.0 -flaky -spidev -termcolor \ No newline at end of file diff --git a/setup.py b/setup.py index 25ee669236..2bac0be6d9 100644 --- a/setup.py +++ b/setup.py @@ -44,12 +44,26 @@ def find_version(*file_paths): platforms='any', license='MIT', install_requires=[ - 'libusb1 == 2.0.1', - 'hexdump >= 3.3', - 'pycryptodome >= 3.9.8', - 'tqdm >= 4.14.0', - 'requests' + 'libusb1', ], + extras_require = { + 'dev': [ + "scons", + "pycryptodome >= 3.9.8", + "cffi", + "flaky", + "pytest", + "pytest-mock", + "pytest-xdist", + "pytest-timeout", + "pytest-randomly", + "parameterized", + "pre-commit", + "numpy", + "ruff", + "spidev", + ], + }, ext_modules=[], description="Code powering the comma.ai panda", long_description='See https://github.com/commaai/panda',