@@ -29,65 +29,17 @@ jobs:
2929 ports:
3030 # Maps tcp port 5432 on service container to the host
3131 - 5432:5432
32- env:
33- # Configure pip to cache dependencies and do a user install
34- PIP_NO_CACHE_DIR: false
35- PIP_USER: 1
36-
37- # Make sure package manager does not use virtualenv
38- POETRY_VIRTUALENVS_CREATE: false
39-
40- # Specify explicit paths for python dependencies and the pre-commit
41- # environment so we know which directories to cache
42- POETRY_CACHE_DIR: ${{ github.workspace }}/.cache/py-user-base
43- PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
44- PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit-cache
4532
4633 steps:
47- - name: Add custom PYTHONUSERBASE to PATH
48- run: echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
49-
5034 - name: Checkout repository
51- uses: actions/checkout@v2
52-
53- - name: Setup python
54- id: python
55- uses: actions/setup-python@v2
56- with:
57- python-version: '3.9.5'
58-
59- # This step caches our Python dependencies. To make sure we
60- # only restore a cache when the dependencies, the python version,
61- # the runner operating system, and the dependency location haven't
62- # changed, we create a cache key that is a composite of those states.
63- #
64- # Only when the context is exactly the same, we will restore the cache.
65- - name: Python Dependency Caching
66- uses: actions/cache@v2
67- id: python_cache
68- with:
69- path: ${{ env.PYTHONUSERBASE }}
70- key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
71- ${{ steps.python.outputs.python-version }}-\
72- ${{ hashFiles('./pyproject.toml', './poetry.lock') }}"
73-
74- # Install our dependencies if we did not restore a dependency cache
75- - name: Install dependencies using Poetry
76- if: steps.python_cache.outputs.cache-hit != 'true'
77- run: |
78- pip install poetry
79- poetry install
35+ uses: actions/checkout@v3
8036
81- # This step caches our pre-commit environment. To make sure we
82- # do create a new environment when our pre-commit setup changes,
83- # we create a cache key based on relevant factors.
84- - name: Pre-commit Environment Caching
85- uses: actions/cache@v2
37+ - name: Install Python Dependencies
38+ uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.2
8639 with:
87- path: ${{ env.PRE_COMMIT_HOME }}
88- key: "precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\
89- ${{ steps.python.outputs.python-version }}-\
90- ${{ hashFiles('./.pre-commit-config.yaml') }}"
40+ # Set dev=true to install flake8 extensions, which are dev dependencies
41+ dev: true
42+ python_version: '3.9'
9143
9244 # We will not run `flake8` here, as we will use a separate flake8
9345 # action. As pre-commit does not support user installs, we set
0 commit comments