Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.9 and 3.10 to the test matrix #1401

Merged
merged 1 commit into from
Jan 11, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Build wheel and source tarball
run: |
pip install wheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
fail-fast: false
matrix:
include:
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3.8
python: python3.9

repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-json
Expand All @@ -16,15 +16,15 @@ repos:
- --autofix
- id: trailing-whitespace
exclude: README.md
- repo: git://github.com/asottile/pyupgrade
rev: v2.24.0
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
- repo: git://github.com/ambv/black
rev: 19.3b0
- repo: https://github.com/ambv/black
rev: 21.12b0
hooks:
- id: black
- repo: git://github.com/PyCQA/flake8
rev: 3.8.4
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
18 changes: 6 additions & 12 deletions graphene/types/tests/test_objecttype.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,15 @@ def test_objecttype_as_container_all_kwargs():


def test_objecttype_as_container_extra_args():
with raises(TypeError) as excinfo:
Container("1", "2", "3")

assert "__init__() takes from 1 to 3 positional arguments but 4 were given" == str(
excinfo.value
)
msg = r"__init__\(\) takes from 1 to 3 positional arguments but 4 were given"
with raises(TypeError, match=msg):
Container("1", "2", "3") # type: ignore


def test_objecttype_as_container_invalid_kwargs():
with raises(TypeError) as excinfo:
Container(unexisting_field="3")

assert "__init__() got an unexpected keyword argument 'unexisting_field'" == str(
excinfo.value
)
msg = r"__init__\(\) got an unexpected keyword argument 'unexisting_field'"
with raises(TypeError, match=msg):
Container(unexisting_field="3") # type: ignore


def test_objecttype_container_benchmark(benchmark):
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ def run_tests(self):


tests_require = [
"pytest>=5.3,<6",
"pytest-benchmark>=3.2,<4",
"pytest-cov>=2.8,<3",
"pytest-mock>=2,<3",
"pytest-asyncio>=0.10,<2",
"snapshottest>=0.5,<1",
"coveralls>=1.11,<2",
"pytest>=6,<7",
"pytest-benchmark>=3.4,<4",
"pytest-cov>=3,<4",
"pytest-mock>=3,<4",
"pytest-asyncio>=0.16,<2",
"snapshottest>=0.6,<1",
"coveralls>=3.3,<4",
"promise>=2.3,<3",
"mock>=4.0,<5",
"pytz==2021.1",
"iso8601>=0.1,<2",
"pytz==2021.3",
"iso8601>=1,<2",
]

dev_requires = ["black==19.10b0", "flake8>=3.7,<4"] + tests_require
Expand All @@ -78,6 +78,8 @@ def run_tests(self):
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
keywords="api graphql protocol rest relay graphene",
packages=find_packages(exclude=["examples*"]),
Expand Down
16 changes: 8 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8,py36,py37,py38,pre-commit,mypy
envlist = py3{6,7,8,9,10}, flake8, mypy, pre-commit
skipsdist = true

[testenv]
Expand All @@ -8,28 +8,28 @@ deps =
setenv =
PYTHONPATH = .:{envdir}
commands =
py{36,37,38}: pytest --cov=graphene graphene examples {posargs}
py{36,37,38,39,310}: pytest --cov=graphene graphene examples {posargs}

[testenv:pre-commit]
basepython=python3.8
basepython = python3.9
deps =
pre-commit>=2,<3
pre-commit>=2.16,<3
setenv =
LC_CTYPE=en_US.UTF-8
commands =
pre-commit run --all-files --show-diff-on-failure

[testenv:mypy]
basepython=python3.8
basepython = python3.9
deps =
mypy>=0.761,<1
mypy>=0.931,<1
commands =
mypy graphene

[testenv:flake8]
basepython=python3.8
basepython = python3.9
deps =
flake8>=3.8,<4
flake8>=4,<5
commands =
pip install --pre -e .
flake8 graphene
Expand Down