aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-09-10 21:20:10 +0100
committerGravatar Chris Lovering <[email protected]>2022-09-10 21:22:32 +0100
commitf209534196a92bbffd251ecd460645e7c54c9286 (patch)
treef0285ca61e1351dbf9af0847cd62422115b26a36 /.github
parentMerge pull request #18 from python-discord/bump-dep (diff)
Use venvs with poetry in Dockerfile
his is required due to a regression in poetry, see https://github.com/HassanAbouelela/actions/pull/7
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/lint-build-deploy.yaml47
1 files changed, 15 insertions, 32 deletions
diff --git a/.github/workflows/lint-build-deploy.yaml b/.github/workflows/lint-build-deploy.yaml
index f28530f..eb2bbd7 100644
--- a/.github/workflows/lint-build-deploy.yaml
+++ b/.github/workflows/lint-build-deploy.yaml
@@ -15,12 +15,11 @@ jobs:
name: Lint
runs-on: ubuntu-latest
env:
- # Configure pip to cache dependencies and do a user install
- PIP_NO_CACHE_DIR: false
- PIP_USER: 1
-
- # Make sure package manager does not use virtualenv
- POETRY_VIRTUALENVS_CREATE: false
+ # Configure pip and poetry to cache dependencies and do an unattended venv install
+ PIP_NO_CACHE_DIR: 1
+ PIP_DISABLE_PIP_VERSION_CHECK: true
+ POETRY_VIRTUALENVS_IN_PROJECT: true
+ POETRY_NO_INTERACTION: true
# Specify explicit paths for python dependencies and the pre-commit
# environment so we know which directories to cache
@@ -28,6 +27,10 @@ jobs:
PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit-cache
+ # See https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763
+ # for why we set this.
+ SETUPTOOLS_USE_DISTUTILS: stdlib
+
steps:
- name: Add custom PYTHONUSERBASE to PATH
run: echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
@@ -35,33 +38,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- - name: Setup python
- id: python
- uses: actions/setup-python@v2
- with:
- python-version: '3.10'
-
- # This step caches our Python dependencies. To make sure we
- # only restore a cache when the dependencies, the python version,
- # the runner operating system, and the dependency location haven't
- # changed, we create a cache key that is a composite of those states.
- #
- # Only when the context is exactly the same, we will restore the cache.
- - name: Python Dependency Caching
- uses: actions/cache@v2
- id: python_cache
+ - name: Install Python Dependencies
+ uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.0
with:
- path: ${{ env.PYTHONUSERBASE }}
- key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
- ${{ steps.python.outputs.python-version }}-\
- ${{ hashFiles('./pyproject.toml', './poetry.lock') }}"
-
- # Install our dependencies if we did not restore a dependency cache
- - name: Install dependencies using poetry
- if: steps.python_cache.outputs.cache-hit != 'true'
- run: |
- pip install poetry
- poetry install
+ # Set dev=true to install flake8 extensions, which are dev dependencies
+ dev: true
+ python_version: '3.10'
+ poetry_version: 'poetry==1.2.0'
# Run flake8 and have it format the linting errors in the format of
# the GitHub Workflow command to register error annotations. This