diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6163d82d..baac2d00 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -36,7 +36,7 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | sudo apt-get update - sudo apt-get install -y --no-install-recommends gcc gettext pandoc + sudo apt-get install -y pandoc # https://github.com/actions/checkout - name: Checkout cc-licenses @@ -61,30 +61,31 @@ jobs: python-version: "3.7" - name: Install pipenv - # Use pipenv 2021.5.29 to circumvent errors: + # Use pipenv 2021.5.29 to circumvent errors with 2021.11.5.post0 on + # Ubuntu 20.04 # https://github.com/pypa/pipenv/issues/4833 run: | - python -m pip install --no-cache-dir --upgrade pip - python -m pip install --no-cache-dir pipenv==2021.5.29 + python -m pip install --upgrade pip + python -m pip install pipenv==2021.5.29 - name: Install Python dependencies run: | - pipenv sync --dev --system + pipenv sync --dev - name: Update Django database schema env: DATA_REPOSITORY_DIR: cc-licenses-data run: | - ./manage.py migrate + pipenv run ./manage.py migrate - name: Start Django development web server env: DATA_REPOSITORY_DIR: cc-licenses-data run: | - ./manage.py runserver &>/dev/null & + pipenv run ./manage.py runserver &>/dev/null & # https://github.com/pre-commit/action - - uses: pre-commit/action@v2.0.3 + - uses: pre-commit/action@v2.0.0 env: DATA_REPOSITORY_DIR: cc-licenses-data diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 426895d2..d21e9326 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,25 +29,25 @@ repos: hooks: - id: black name: "Black" - entry: black --check + entry: pipenv run black --check language: system types: ["file", "python", "text"] - id: flake8 name: "Flake8" - entry: flake8 + entry: pipenv run flake8 language: system types: ["file", "python", "text"] - id: isort name: "isort" - entry: isort --check --filter-files + entry: pipenv run isort --check --filter-files language: system types: ["file", "python", "text"] - id: missing-migrations name: 'Missing migrations' - entry: ./manage.py makemigrations --check + entry: pipenv run ./manage.py makemigrations --check language: system types: ["file", "python", "text"] pass_filenames: false @@ -55,7 +55,7 @@ repos: # This test fails if web server is not running - id: coverage-test name: 'Run Django tests' - entry: coverage run manage.py test --noinput --keepdb + entry: pipenv run coverage run manage.py test --noinput --keepdb language: system types: ["file", "python", "text"] pass_filenames: false @@ -63,7 +63,7 @@ repos: - id: coverage-report name: 'Confirm test coverage' - entry: coverage report + entry: pipenv run coverage report language: system types: ["file", "python", "text"] pass_filenames: false