diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index b918619..a3ebd77 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -11,33 +11,38 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install poetry - run: | - pipx install poetry - poetry config installer.modern-installation false - poetry config virtualenvs.in-project true + - name: Install rye + uses: eifinger/setup-rye@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Load cached venv + id: cached-venv-dependencies + uses: actions/cache@v4 with: - python-version: ${{ matrix.python-version }} - cache: poetry - cache-dependency-path: | - **/poetry.lock + path: .venv + key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} - name: Install dependencies + if: steps.cached-venv-dependencies.outputs.cache-hit != 'true' run: | - poetry install --all-extras --with=dev + rye pin cpython@${{ matrix.python-version }} + rye sync --all-features + + - name: Load cached pre-commit + id: cached-pre-commit-dependencies + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: precommit-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} - name: Code checks run: | - poetry run pre-commit run --all-files --show-diff-on-failure + rye run pre-commit run --all-files --show-diff-on-failure - name: Test with pytest run: | - poetry run pytest \ No newline at end of file + rye run pytest diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 003e92a..c22e828 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,7 @@ jobs: steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: "${{ secrets.GITHUB_TOKEN }}" fetch-depth: 0 @@ -25,25 +25,24 @@ jobs: poetry config installer.modern-installation false poetry config virtualenvs.in-project true - - name: Setup Python Env ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install rye + uses: eifinger/setup-rye@v1 + - name: Install dependencies run: pip install dunamai - name: Build package run: | VERSION=$(dunamai from any --no-metadata --style pep440) - poetry version $VERSION - echo "from __future__ import annotations - - __version__: str = \"$VERSION\"" > \ - src/timeout_executor/_version.py - poetry build + rye version $VERSION + rye build - name: Release to PyPI run: | - poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} || \ + rye publish --token ${{ secrets.PYPI_API_TOKEN }} --yes || \ echo 'Version exists' \ No newline at end of file