Skip to content

Commit

Permalink
use .venv
Browse files Browse the repository at this point in the history
  • Loading branch information
anis-campos committed Dec 4, 2023
1 parent 4981b91 commit 6af8717
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
id: cache-venv
uses: actions/[email protected]
with:
path: venv
path: .venv
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-python-key.outputs.key }}
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
id: cache-venv
uses: actions/[email protected]
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
Expand All @@ -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
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 6af8717

Please sign in to comment.