From 8ffce8b81935012b5411fb09099ba3d084d6851f Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Wed, 20 Dec 2023 15:59:19 -0800 Subject: [PATCH] Enable caching of package dependencies (#442) Fixes #437 --- .github/workflows/python-package.yaml | 2 +- Dockerfile | 1 + action/diff/action.yml | 5 +++-- action/test/action.yml | 5 +++-- requirements.txt | 1 - 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yaml b/.github/workflows/python-package.yaml index be3a44cc..df59cbf8 100644 --- a/.github/workflows/python-package.yaml +++ b/.github/workflows/python-package.yaml @@ -33,8 +33,8 @@ jobs: cache: "pip" - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -r requirements.txt + pip install -e . - name: Install extra packages run: | ${{ matrix.pydantic-install }} diff --git a/Dockerfile b/Dockerfile index 5e7487f0..df9a7a52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,5 +53,6 @@ RUN flux version --client COPY . /src/ WORKDIR /src/ RUN pip3 install -r /src/requirements.txt +RUN pip3 install -e /src/ SHELL ["/bin/bash", "-c"] diff --git a/action/diff/action.yml b/action/diff/action.yml index 4963ff7b..08d73126 100644 --- a/action/diff/action.yml +++ b/action/diff/action.yml @@ -58,9 +58,10 @@ runs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} - - name: Install flux-local + cache: pip + - name: Install flux-local and requirements run: | - python -m pip install --upgrade pip + pip install -r ${{ github.action_path }}/../../requirements.txt pip install -e ${{ github.action_path }}/../../ shell: bash - name: Checkout PR branch diff --git a/action/test/action.yml b/action/test/action.yml index 96038e7f..f2c6ebcb 100644 --- a/action/test/action.yml +++ b/action/test/action.yml @@ -43,9 +43,10 @@ runs: uses: actions/setup-python@v4 with: python-version: ${{ inputs.python-version }} - - name: Install flux-local + cache: pip + - name: Install flux-local and requirements run: | - python -m pip install --upgrade pip + pip install -r ${{ github.action_path }}/../../requirements.txt pip install -e ${{ github.action_path }}/../../ shell: bash - uses: supplypike/setup-bin@v3 diff --git a/requirements.txt b/requirements.txt index 6dc14592..92fa3358 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ --e . aiofiles==23.2.1 black==23.12.0 coverage==7.3.3