Skip to content

Commit

Permalink
Add support for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelane authored and Tinche committed Nov 4, 2019
1 parent 7311176 commit bb48897
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -19,6 +19,8 @@ matrix:
env: TOXENV=py36
- python: "3.7"
env: TOXENV=py37
- python: "3.8"
env: TOXENV=py38
dist: xenial
sudo: true

Expand Down
4 changes: 4 additions & 0 deletions HISTORY.rst
Expand Up @@ -9,6 +9,10 @@ History
* ``cattrs`` has improved type annotations for use with Mypy.
* Unstructuring sets and frozensets now works properly.

0.9.1 (2019-10-26)
------------------
* Python 3.8 support.

0.9.0 (2018-07-22)
------------------
* Python 3.7 support.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -55,5 +55,6 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
)
3 changes: 2 additions & 1 deletion src/cattr/_compat.py
Expand Up @@ -13,6 +13,7 @@
is_py2 = version_info[0] == 2
is_py3 = version_info[0] == 3
is_py37 = version_info[:2] == (3, 7)
is_py38 = version_info[:2] == (3, 8)

if is_py2:
from functools32 import lru_cache
Expand All @@ -26,7 +27,7 @@
unicode = str
bytes = bytes

if is_py37:
if is_py37 or is_py38:
from typing import List, Union, _GenericAlias

def is_union_type(obj):
Expand Down
8 changes: 6 additions & 2 deletions tests/_compat.py
@@ -1,6 +1,10 @@
from cattr._compat import is_py37, is_bare
from cattr._compat import (
is_py37,
is_py38,
is_bare
)

if is_py37:
if is_py37 or is_py38:

def change_type_param(cl, new_params):
if is_bare(cl):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py27, pypy, py35, pypy3, py36, py37, lint
envlist = py27, pypy, py35, pypy3, py36, py37, py38, lint

[testenv:lint]
skip_install = true
Expand Down

0 comments on commit bb48897

Please sign in to comment.