Skip to content

Commit

Permalink
feat: add python 3.9 and 3.10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas03 committed Aug 30, 2022
1 parent cf59148 commit 0dc2dd5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: '3.10'
- name: Install setuptools
run: >-
python -m
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('*requirements.txt') }}
strategy:
matrix:
toxenv: [py37, py38, py38-simplejson]

toxenv: [py37, py38, py39, py310, py310-simplejson]
9 changes: 4 additions & 5 deletions kw/json/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ def wrapper(*args, **kwargs):
try:
result = func(*args, **kwargs)
except TypeError as err:
if (
str(err)
== "__init__() got an unexpected keyword argument 'use_decimal'"
if str(err).endswith(
"__init__() got an unexpected keyword argument 'use_decimal'"
):
raise KiwiJsonError(
raise KiwiJsonError( # pylint: disable=W0707
__use_decimal_error_message
) # pylint: disable=W0707
)
raise
return result

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
[tox]
envlist = py{37,38},py38-simplejson,black,pylint
envlist = py{37,38,39,310},py310-simplejson,black,pylint

[testenv]
deps = -rtest-requirements.txt
basepython =
py37: {env:TOXPYTHON:python3.7}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
skip_install = True
passenv =
DATABASE_URI
commands = pytest test {posargs:}

[testenv:py38-simplejson]
[testenv:py310-simplejson]
deps =
-rtest-requirements.txt
simplejson
skip_install = True
commands = pytest test {posargs:}

[testenv:pylint]
basepython = python3.8
basepython = python3.10
deps =
pylint==2.14.5
-rtest-requirements.txt
skip_install = True
commands = pylint {posargs:} kw/json test

[testenv:black]
basepython = python3.8
basepython = python3.10
deps =
black
-rtest-requirements.txt
skip_install = True
commands = black {posargs:} -l 120 --target-version py38 kw test
commands = black {posargs:} -l 120 --target-version py310 kw test

0 comments on commit 0dc2dd5

Please sign in to comment.