diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4f68e8d9851..bdf659aea3e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -42,7 +42,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" + cache: poetry - name: Setup Node uses: actions/setup-node@v4 @@ -54,7 +55,7 @@ jobs: - name: Fetch Documentation run: | - python -m pip install poetry + pipx install poetry poetry install --no-root --only main poetry run python bin/website build --local ./poetry diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf37894a02a..0945a0eb470 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,26 +42,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Bootstrap poetry + run: pipx install poetry + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - - name: Get full Python version - id: full-python-version - run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT - - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y - - - name: Update PATH - if: ${{ matrix.os != 'Windows' }} - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Update Path for Windows - if: ${{ matrix.os == 'Windows' }} - run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH + cache: poetry - name: Enable long paths for git on Windows if: ${{ matrix.os == 'Windows' }} @@ -70,23 +58,10 @@ jobs: run: git config --system core.longpaths true - name: Configure poetry - run: poetry config virtualenvs.in-project true - - - name: Set up cache - uses: actions/cache@v4 - id: cache - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cache.outputs.cache-hit == 'true' run: | - # `timeout` is not available on macOS, so we define a custom function. - [ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } - - # Using `timeout` is a safeguard against the Poetry command hanging for some reason. - timeout 10s poetry run pip --version || rm -rf .venv + poetry config virtualenvs.in-project true + poetry config virtualenvs.options.no-pip true + poetry config virtualenvs.options.no-setuptools true - name: Check lock file run: poetry check --lock diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 107a3910521..359cfb9f28d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,14 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y + run: pipx install poetry - - name: Update PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: poetry - name: Build project for distribution run: poetry build