From 04645cb7fad3055a0d553f58c7f486f74b80ded4 Mon Sep 17 00:00:00 2001 From: JulesBelveze Date: Tue, 4 Jul 2023 13:14:37 +0200 Subject: [PATCH] CI: update build mechanism --- .github/workflows/build_and_test.yml | 28 ++++++++++++---------------- .github/workflows/requirements.txt | 17 ----------------- 2 files changed, 12 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/requirements.txt diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 7f21da5f2..c273b5c09 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -28,27 +28,23 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Create virtual environment - run: python -m venv venv + - name: Cache poetry install + uses: actions/cache@v2 + with: + path: ~/.local + key: poetry-1.3.1 - - name: Activate virtual environment - run: | - ls - source ./venv/bin/activate + - uses: snok/install-poetry@v1 + with: + version: 1.3.1 + virtualenvs-create: true + virtualenvs-in-project: true - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f .github/workflows/requirements.txt ]; then pip install -r .github/workflows/requirements.txt; fi + poetry install --with dev - - 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 --exclude=venv - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --exclude=venv --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | python -m spacy download en_core_web_sm - pytest + poetry run task test diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt deleted file mode 100644 index 4a6a8f5bf..000000000 --- a/.github/workflows/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -numpy -pandas -scikit-learn -transformers==4.28.1 -torch -sentencepiece -pydantic==1.10.6 -spacy -johnsnowlabs==4.3.5 -asyncio -nest-asyncio -jsonlines -openai -langchain -evaluate -rouge_score -typing-extensions < 4.6.0