Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,59 @@ on:

jobs:
ci:
runs-on: ${{ matrix.os }}
container: docker://altendky/hydra:ubuntu-20.04-3-minors
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python:
- version: "3.7"
bin: python3.7
tox: py37,report,codecov
- version: "3.8"
bin: python3.8
tox: py38,report,codecov
- version: "3.9"
bin: python3.9
tox: py39,report,codecov
- version: "3.10"
bin: python3.10
tox: py310,report,codecov
- version: "3.11"
bin: python3.11
tox: py311,report,codecov
- version: pypy-3.7
bin: pypy3
tox: pypy3,report,codecov
env:
TOXTOOLPYTHON: "${{ matrix.python.bin }}"
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.version }}
- name: Install
run: |
pip install tox
- name: Test
run: |
tox -v -e "${{ matrix.python.tox }}"
linting:
name: Linting
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.10"]
toxenv:
- py37,report,codecov
- py38,report,codecov
- py39,report,codecov
- pypy3,report,codecov
- doc
- check
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: Install
run: |
pip install tox
Expand All @@ -37,6 +74,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- ci
- linting
steps:
- name: This
shell: python
Expand Down
1 change: 1 addition & 0 deletions changelog.d/238.changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support to Python 3.10 and 3.11.
2 changes: 1 addition & 1 deletion src/desert/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def field_for_schema(

# t.NewType returns a function with a __supertype__ attribute
newtype_supertype = getattr(typ, "__supertype__", None)
if newtype_supertype and inspect.isfunction(typ):
if newtype_supertype and typing_inspect.is_new_type(typ):
metadata.setdefault("description", typ.__name__)
field = field_for_schema(newtype_supertype, default=default)

Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envlist =
clean,
check,
doc,
{py37,py38,py39,pypy3},
{py37,py38,py39,py310,py311,pypy3},
report

[testenv]
Expand All @@ -14,7 +14,9 @@ basepython =
py37: {env:TOXPYTHON:python3.7}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
{doc,spell,bootstrap,clean,check,report,codecov}: {env:TOXTOOLPYTHON:python3.8}
py310: {env:TOXPYTHON:python3.10}
py311: {env:TOXPYTHON:python3.11}
{doc,spell,bootstrap,clean,check,report,codecov}: {env:TOXTOOLPYTHON:python3.10}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
Expand Down