From 6877a1f43e7a10a934180d718adb3b18f01bdbd7 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Thu, 11 Aug 2022 15:50:11 +0300 Subject: [PATCH] Give up installing packages system-wide in GH Actions --- .github/workflows/cicd.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 178a2641d..c1567c532 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -29,12 +29,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Poetry uses: snok/install-poetry@2bf112a0f6979928eb6b011f39700db589c5961e # v1.3.1 - with: - virtualenvs-create: false - name: Install Python dependencies run: | poetry install --no-interaction --no-root - python -m nltk.downloader punkt + poetry run python -m nltk.downloader punkt # Selectively install the optional dependencies for some Python versions # Install the optional neural network dependencies (TensorFlow and LMDB) # - except for one Python version (3.9) so that we can test also without them @@ -48,7 +46,7 @@ jobs: if [[ ${{ matrix.python-version }} == '3.9' ]]; then poetry install -E spacy # download the small English pretrained spaCy model needed by spacy analyzer - python -m spacy download en_core_web_sm --upgrade-strategy only-if-needed + poetry run python -m spacy download en_core_web_sm --upgrade-strategy only-if-needed fi # For Python 3.8 # - voikko and pycld3 dependencies @@ -57,9 +55,9 @@ jobs: - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | poetry run pytest --cov=./ --cov-report xml