diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2a6cdc6b..07c0766f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 95251d9b..c9efc0cf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdc4d01e..4a8bd62e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd6a7340..2ba6d1f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/graphene/types/tests/test_objecttype.py b/graphene/types/tests/test_objecttype.py index 1ff8fc8f..dece5e8b 100644 --- a/graphene/types/tests/test_objecttype.py +++ b/graphene/types/tests/test_objecttype.py @@ -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): diff --git a/setup.py b/setup.py index ae59a92a..517fd7b3 100644 --- a/setup.py +++ b/setup.py @@ -45,17 +45,17 @@ class PyTest(TestCommand): 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 @@ -78,6 +78,8 @@ setup( "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*"]), diff --git a/tox.ini b/tox.ini index c4bf6ad0..96a40546 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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