From 6af87176075c00f820933854720b76834a377db0 Mon Sep 17 00:00:00 2001 From: Anis Da Silva Campos Date: Mon, 4 Dec 2023 20:53:07 +0100 Subject: [PATCH] use .venv --- .github/workflows/checks.yaml | 6 +++--- Makefile | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 923e963..d84b674 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -50,7 +50,7 @@ jobs: id: cache-venv uses: actions/cache@v3.3.2 with: - path: venv + path: .venv key: >- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ steps.generate-python-key.outputs.key }} @@ -88,7 +88,7 @@ jobs: id: cache-venv uses: actions/cache@v3.3.2 with: - path: venv + path: .venv fail-on-cache-miss: true key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ needs.prepare-base.outputs.python-key }} - name: Restore pre-commit environment @@ -102,5 +102,5 @@ jobs: run: make install - name: Run pylint checks run: | - . venv/bin/activate + . .venv/bin/activate pre-commit run pylint --all-files diff --git a/Makefile b/Makefile index 03d1c56..dac458c 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,25 @@ # Use python executables inside venv -export PATH := ./venv/bin:$(PATH) +export PATH := .venv/bin:$(PATH) export PYTHONPATH=. # creates the venv -venv/bin/python3.11: - python3.11 -m venv venv +.venv/bin/python3.11: + python3.11 -m venv .venv # makes sures the venv contains a given version of pip and pip-tools -venv: venv/bin/python3.11 +.venv: .venv/bin/python3.11 pip install --quiet --upgrade 'pip==23.3.1' 'pip-tools==7.3' # generates a lock file with pinned version of all dependencies to be used by the CI and local devs -dev-requirements.txt: venv dev-requirements.in setup.py +dev-requirements.txt: .venv dev-requirements.in pyproject.toml pip-compile \ --quiet --generate-hashes --max-rounds=20 --strip-extras \ --resolver=backtracking \ --output-file dev-requirements.txt \ - dev-requirements.in setup.cfg + dev-requirements.in pyproject.toml # upgrades the dependencies to their latest/matching version -upgrade: venv +upgrade: .venv pip-compile \ --quiet --generate-hashes --max-rounds=20 --strip-extras \ --upgrade \ @@ -30,8 +30,8 @@ upgrade: venv # creates the venv if not present then install the dependencies, the package and pre-commit .PHONY: install -install: venv - pip-sync dev-requirements.txt +install: .venv + pip-sync dev-requirements.txt # install pylint_pytest (deps are already handled by the line before) pip install --no-deps -e . # install pre-commit hooks