Skip to content

Commit

Permalink
Test on Python 3.12 (#207)
Browse files Browse the repository at this point in the history
* Test on Python 3.12

* Upgrade Poetry from 1.5.1 to 1.6.1

* Use same tox locally and in CI

* Update test setup to work on Python 3.12
  • Loading branch information
jodal committed Oct 5, 2023
1 parent 6b5ad80 commit dbb881a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,24 @@ jobs:
- name: "Test: Python 3.11"
python: "3.11"
tox: py311
- name: "Test: Python 3.12"
python: "3.12"
tox: py312
coverage: true
- name: "Lint: black"
python: "3.11"
python: "3.12"
tox: black
- name: "Lint: mypy"
python: "3.11"
python: "3.12"
tox: mypy
- name: "Lint: pyright"
python: "3.11"
python: "3.12"
tox: pyright
- name: "Lint: ruff"
python: "3.11"
python: "3.12"
tox: ruff
- name: "Docs"
python: "3.11"
python: "3.12"
tox: docs

name: ${{ matrix.name }}
Expand All @@ -56,7 +59,7 @@ jobs:
key: ${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-${{ hashFiles('pyproject.toml', 'tox.ini') }} }}
restore-keys: |
${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-
- run: python -m pip install poetry==1.5.1 tox==4.5.2
- run: python -m pip install poetry==1.6.1 tox==4.11.3
- run: python -m tox -e ${{ matrix.tox }}
if: ${{ ! matrix.coverage }}
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
- run: python -m pip install poetry==1.5.1 tox==4.5.2
- run: tox --skip-missing-interpreters true
- run: poetry build
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
poetry 1.5.1
python 3.11 3.10 3.9 3.8
poetry 1.6.1
python 3.12 3.11 3.10 3.9 3.8
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pytest-cov = "^4.1.0"
pytest-mock = "^3.11.1"

[tool.black]
target-version = ["py38", "py39", "py310", "py311"]
target-version = ["py38", "py39", "py310", "py311", "py312"]

[tool.coverage.paths]
source = ["src"]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import asyncio
import sys
import traceback
import types
from typing import TYPE_CHECKING, Any, Generator, Iterable, List

import pytest
Expand Down Expand Up @@ -145,6 +146,7 @@ async def get_value() -> int:
def test_future_supports_yield_from_syntax(
future: Future[int],
) -> None:
@types.coroutine
def get_value() -> Generator[None, None, int]:
val = yield from future
return val
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = true
envlist = py38, py39, py310, black, docs, mypy, ruff
envlist = py38, py39, py310, py311, py312, black, docs, mypy, ruff

[testenv]
allowlist_externals = poetry
Expand Down

0 comments on commit dbb881a

Please sign in to comment.