From 58066443de62f83b2ac4c0606621b2397d1500cb Mon Sep 17 00:00:00 2001
From: Trenton Holmes <trenton.holmes@psware.com>
Date: Sat, 12 Mar 2022 16:12:49 -0800
Subject: [PATCH 1/5] Updates GHA to use the setup-python pipenv caching

---
 .github/workflows/ci.yml | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 501a80adf..abf7a0ce0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -106,34 +106,30 @@ jobs:
       -
         name: Checkout
         uses: actions/checkout@v2
+      -
+        name: Install pipenv
+        run: pip install pipenv
       -
         name: Set up Python
         uses: actions/setup-python@v2
         with:
           python-version: "${{ matrix.python-version }}"
+          cache: "pipenv"
       -
-        name: Get pip cache dir
-        id: pip-cache
-        run: |
-          echo "::set-output name=dir::$(pip cache dir)"
-      -
-        name: Persistent Github pip cache
-        uses: actions/cache@v2
-        with:
-          path: ${{ steps.pip-cache.outputs.dir }}
-          key: ${{ runner.os }}-pip${{ matrix.python-version }}
-      -
-        name: Install dependencies
+        name: Install system dependencies
         run: |
           sudo apt-get update -qq
           sudo apt-get install -qq --no-install-recommends unpaper tesseract-ocr imagemagick ghostscript optipng
+      -
+        name: Install Python dependencies
+        run: |
           pip install --upgrade pipenv
-          pipenv install --system --dev --ignore-pipfile
+          pipenv install --dev --ignore-pipfile
       -
         name: Tests
         run: |
           cd src/
-          pytest
+          pipenv run pytest
       -
         name: Publish coverage results
         if: matrix.python-version == '3.9'
@@ -325,4 +321,4 @@ jobs:
           upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
           asset_path: ./paperless-ngx.tar.xz
           asset_name: paperless-ngx-${{ steps.get_version.outputs.version }}.tar.xz
-          asset_content_type: application/x-xz
\ No newline at end of file
+          asset_content_type: application/x-xz

From 3a8cffe3ce732ef9dffca0575b4d464c57dfd0e4 Mon Sep 17 00:00:00 2001
From: Trenton Holmes <trenton.holmes@psware.com>
Date: Sat, 12 Mar 2022 16:19:23 -0800
Subject: [PATCH 2/5] Removes duplicated install of pipenv, changes to use pipx
 as per the official example

---
 .github/workflows/ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index abf7a0ce0..7aebf6ed1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -108,13 +108,14 @@ jobs:
         uses: actions/checkout@v2
       -
         name: Install pipenv
-        run: pip install pipenv
+        run: pipx install pipenv
       -
         name: Set up Python
         uses: actions/setup-python@v2
         with:
           python-version: "${{ matrix.python-version }}"
           cache: "pipenv"
+          cache-dependency-path: 'Pipfile.lock'
       -
         name: Install system dependencies
         run: |
@@ -123,7 +124,6 @@ jobs:
       -
         name: Install Python dependencies
         run: |
-          pip install --upgrade pipenv
           pipenv install --dev --ignore-pipfile
       -
         name: Tests

From f33cf6cc2ea59dcc96879227e904238649f0cbbd Mon Sep 17 00:00:00 2001
From: Trenton Holmes <trenton.holmes@psware.com>
Date: Sat, 12 Mar 2022 16:21:30 -0800
Subject: [PATCH 3/5] Fixes coveralls not running

---
 .github/workflows/ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7aebf6ed1..4adc9854a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -138,7 +138,7 @@ jobs:
         # https://github.com/coveralls-clients/coveralls-python/issues/251
         run: |
           cd src/
-          coveralls --service=github
+          pipenv run coveralls --service=github
 
   # build and push image to docker hub.
   build-docker-image:

From 1549edfd5529852f2945e6c534d1c15e9ccefc2e Mon Sep 17 00:00:00 2001
From: Trenton Holmes <trenton.holmes@psware.com>
Date: Sat, 12 Mar 2022 16:36:55 -0800
Subject: [PATCH 4/5] Changes codestyle and documentation steps to use cache as
 well

---
 .github/workflows/ci.yml | 42 ++++++++++++++--------------------------
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4adc9854a..bd322147c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,32 +18,25 @@ jobs:
       -
         name: Checkout
         uses: actions/checkout@v2
+      -
+        name: Install pipenv
+        run: pipx install pipenv
       -
         name: Set up Python
         uses: actions/setup-python@v2
         with:
           python-version: 3.9
-      -
-        name: Get pip cache dir
-        id: pip-cache
-        run: |
-          echo "::set-output name=dir::$(pip cache dir)"
-      -
-        name: Persistent Github pip cache
-        uses: actions/cache@v2
-        with:
-          path: ${{ steps.pip-cache.outputs.dir }}
-          key: ${{ runner.os }}-pip3.8}
+          cache: "pipenv"
+          cache-dependency-path: 'Pipfile.lock'
       -
         name: Install dependencies
         run: |
-          pip install --upgrade pipenv
-          pipenv install --system --dev --ignore-pipfile
+          pipenv install --dev --ignore-pipfile
       -
         name: Make documentation
         run: |
           cd docs/
-          make html
+          pipenv run make html
       -
         name: Upload artifact
         uses: actions/upload-artifact@v2
@@ -57,32 +50,25 @@ jobs:
       -
         name: Checkout
         uses: actions/checkout@v2
+      -
+        name: Install pipenv
+        run: pipx install pipenv
       -
         name: Set up Python
         uses: actions/setup-python@v2
         with:
           python-version: 3.9
-      -
-        name: Get pip cache dir
-        id: pip-cache
-        run: |
-          echo "::set-output name=dir::$(pip cache dir)"
-      -
-        name: Persistent Github pip cache
-        uses: actions/cache@v2
-        with:
-          path: ${{ steps.pip-cache.outputs.dir }}
-          key: ${{ runner.os }}-pip${{ matrix.python-version }}
+          cache: "pipenv"
+          cache-dependency-path: 'Pipfile.lock'
       -
         name: Install dependencies
         run: |
-          pip install --upgrade pipenv
-          pipenv install --system --dev --ignore-pipfile
+          pipenv install --dev --ignore-pipfile
       -
         name: Codestyle
         run: |
           cd src/
-          pycodestyle --max-line-length=88 --ignore=E121,E123,E126,E226,E24,E704,W503,W504,E203
+          pipenv run pycodestyle --max-line-length=88 --ignore=E121,E123,E126,E226,E24,E704,W503,W504,E203
   codeformatting:
     runs-on: ubuntu-20.04
     steps:

From 35de8e6ad573e76c637c05211a825ba742f14508 Mon Sep 17 00:00:00 2001
From: Trenton Holmes <trenton.holmes@psware.com>
Date: Sun, 13 Mar 2022 08:20:40 -0700
Subject: [PATCH 5/5] Changes the pipenv install to be a sync

---
 .github/workflows/ci.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bd322147c..ab700c0dc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,7 +31,7 @@ jobs:
       -
         name: Install dependencies
         run: |
-          pipenv install --dev --ignore-pipfile
+          pipenv sync --dev
       -
         name: Make documentation
         run: |
@@ -63,7 +63,7 @@ jobs:
       -
         name: Install dependencies
         run: |
-          pipenv install --dev --ignore-pipfile
+          pipenv sync --dev
       -
         name: Codestyle
         run: |
@@ -110,7 +110,7 @@ jobs:
       -
         name: Install Python dependencies
         run: |
-          pipenv install --dev --ignore-pipfile
+          pipenv sync --dev
       -
         name: Tests
         run: |