From ef0210b38430998e515ee05abf04b9cb29a7a5ad Mon Sep 17 00:00:00 2001 From: soaska <79996669747@ya.ru> Date: Fri, 3 May 2024 19:13:54 +0300 Subject: [PATCH] venv? --- .gitea/workflows/on_pull_request.yaml | 10 ++++++---- .gitea/workflows/run_tests.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/on_pull_request.yaml b/.gitea/workflows/on_pull_request.yaml index f53420e2..78cc2be0 100644 --- a/.gitea/workflows/on_pull_request.yaml +++ b/.gitea/workflows/on_pull_request.yaml @@ -22,16 +22,18 @@ jobs: # not to have GHA download an (at the time of writing) 4 GB cache # of PyTorch and other dependencies. - name: create venv - run: python -m venv venv && source venv/bin/activate + run: python -m venv venv - name: Install Ruff - run: pip install ruff==0.1.6 + run: venv/bin/pip3 install ruff==0.1.6 - name: Run Ruff - run: ruff . + run: venv/bin/ruff . lint-js: name: eslint - runs-on: ubuntu-latest + runs-on: soaska if: gitea.event_name != 'pull_request' || gitea.event.pull_request.head.repo.full_name != gitea.event.pull_request.base.repo.full_name steps: + - name: Prepare env + run: apk add --no-cache nodejs git curl python3 - name: Checkout Code uses: actions/checkout@v3 - name: Install Node.js diff --git a/.gitea/workflows/run_tests.yaml b/.gitea/workflows/run_tests.yaml index a2bbfbac..6ad69c73 100644 --- a/.gitea/workflows/run_tests.yaml +++ b/.gitea/workflows/run_tests.yaml @@ -26,7 +26,7 @@ jobs: **/requirements*txt launch.py - name: create venv - run: python -m venv venv && source venv/bin/activate + run: python -m venv venv - name: Cache models id: cache-models uses: actions/cache@v3 @@ -34,12 +34,12 @@ jobs: path: models key: "2023-12-30" - name: Install test dependencies - run: pip install wait-for-it -r requirements-test.txt + run: venv/bin/pip3 install wait-for-it -r requirements-test.txt env: PIP_DISABLE_PIP_VERSION_CHECK: "1" PIP_PROGRESS_BAR: "off" - name: Setup environment - run: python launch.py --skip-torch-cuda-test --exit + run: venv/bin/python3 launch.py --skip-torch-cuda-test --exit env: PIP_DISABLE_PIP_VERSION_CHECK: "1" PIP_PROGRESS_BAR: "off" @@ -47,7 +47,7 @@ jobs: WEBUI_LAUNCH_LIVE_OUTPUT: "1" PYTHONUNBUFFERED: "1" - name: Print installed packages - run: pip freeze + run: /venv/bin/pip3 freeze - name: Download models run: | declare -a urls=( @@ -73,7 +73,7 @@ jobs: # done - name: Start test server run: > - python -m coverage run + venv/bin/python3 -m coverage run --data-file=.coverage.server launch.py --skip-prepare-environment @@ -89,7 +89,7 @@ jobs: - name: Run tests run: | wait-for-it --service 127.0.0.1:7860 -t 20 - python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test + venv/bin/python3 -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test # TODO(huchenlei): Enable ControlNet tests. Currently it is too slow to run these tests on CPU with # real SD model. We need to find a way to load empty SD model. # - name: Run ControlNet tests