From dcbbb948bd747aae19a015b5ed316ad1d214446d Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Sat, 2 Oct 2021 22:12:28 +0300 Subject: [PATCH 1/5] Add Python 3.10 testing (and support) --- .github/workflows/pr-bandit.yml | 1 + .github/workflows/pr-python310.yml | 50 ++++++++++++++++++++++++++++ .github/workflows/pr-type-check.yml | 1 + .github/workflows/pr-windows.yml | 1 + .github/workflows/publish-images.yml | 2 +- setup.py | 1 + 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-python310.yml diff --git a/.github/workflows/pr-bandit.yml b/.github/workflows/pr-bandit.yml index 6ba4c0d527..cf4facd348 100644 --- a/.github/workflows/pr-bandit.yml +++ b/.github/workflows/pr-bandit.yml @@ -16,6 +16,7 @@ jobs: - { python-version: 3.7, tox-env: security} - { python-version: 3.8, tox-env: security} - { python-version: 3.9, tox-env: security} + - { python-version: 3.10, tox-env: security} steps: - name: Checkout the repository uses: actions/checkout@v2 diff --git a/.github/workflows/pr-python310.yml b/.github/workflows/pr-python310.yml new file mode 100644 index 0000000000..b826339df4 --- /dev/null +++ b/.github/workflows/pr-python310.yml @@ -0,0 +1,50 @@ +name: Python 3.10 Tests +on: + pull_request: + branches: + - main + push: + branches: + - main + paths: + - sanic/* + - tests/* + +jobs: + testPy39: + name: ut-${{ matrix.config.tox-env }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] + config: + - { + python-version: 3.10, + tox-env: py310, + ignore-error-flake: "false", + command-timeout: "0", + } + - { + python-version: 3.10, + tox-env: py310-no-ext, + ignore-error-flake: "true", + command-timeout: "600000", + } + steps: + - name: Checkout the Repository + uses: actions/checkout@v2 + id: checkout-branch + + - name: Run Unit Tests + uses: harshanarayana/custom-actions@main + with: + python-version: ${{ matrix.config.python-version }} + test-infra-tool: tox + test-infra-version: latest + action: tests + test-additional-args: "-e=${{ matrix.config.tox-env }},-vv=''" + experimental-ignore-error: "${{ matrix.config.ignore-error-flake }}" + command-timeout: "${{ matrix.config.command-timeout }}" + test-failure-retry: "3" diff --git a/.github/workflows/pr-type-check.yml b/.github/workflows/pr-type-check.yml index c5d12a74d5..8f920f6bc9 100644 --- a/.github/workflows/pr-type-check.yml +++ b/.github/workflows/pr-type-check.yml @@ -16,6 +16,7 @@ jobs: - { python-version: 3.7, tox-env: type-checking} - { python-version: 3.8, tox-env: type-checking} - { python-version: 3.9, tox-env: type-checking} + - { python-version: 3.10, tox-env: type-checking} steps: - name: Checkout the repository uses: actions/checkout@v2 diff --git a/.github/workflows/pr-windows.yml b/.github/workflows/pr-windows.yml index e3a32e5d87..99b0ceaacf 100644 --- a/.github/workflows/pr-windows.yml +++ b/.github/workflows/pr-windows.yml @@ -15,6 +15,7 @@ jobs: - { python-version: 3.7, tox-env: py37-no-ext } - { python-version: 3.8, tox-env: py38-no-ext } - { python-version: 3.9, tox-env: py39-no-ext } + - { python-version: 3.10, tox-env: py39-no-ext } - { python-version: pypy-3.7, tox-env: pypy37-no-ext } steps: diff --git a/.github/workflows/publish-images.yml b/.github/workflows/publish-images.yml index 8c78f96c8f..621f34a009 100644 --- a/.github/workflows/publish-images.yml +++ b/.github/workflows/publish-images.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.7", "3.8", "3.9"] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - name: Checkout repository diff --git a/setup.py b/setup.py index ecbf1e07c9..f9c23c14cf 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ def open_local(paths, mode="r", encoding="utf8"): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], "entry_points": {"console_scripts": ["sanic = sanic.__main__:main"]}, } From 3448a0fb949f2a31943b162bfce5921a7a6b5374 Mon Sep 17 00:00:00 2001 From: Stephen Sadowski Date: Sun, 24 Oct 2021 17:00:43 -0500 Subject: [PATCH 2/5] fixed py310 tox environment for windows, quoted '3.10' in python-310 tests to avoid numeric compression --- .github/workflows/pr-python310.yml | 4 ++-- .github/workflows/pr-windows.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-python310.yml b/.github/workflows/pr-python310.yml index b826339df4..713f6495e0 100644 --- a/.github/workflows/pr-python310.yml +++ b/.github/workflows/pr-python310.yml @@ -21,13 +21,13 @@ jobs: os: [ubuntu-latest] config: - { - python-version: 3.10, + python-version: "3.10", tox-env: py310, ignore-error-flake: "false", command-timeout: "0", } - { - python-version: 3.10, + python-version: "3.10", tox-env: py310-no-ext, ignore-error-flake: "true", command-timeout: "600000", diff --git a/.github/workflows/pr-windows.yml b/.github/workflows/pr-windows.yml index 99b0ceaacf..4e31d775cc 100644 --- a/.github/workflows/pr-windows.yml +++ b/.github/workflows/pr-windows.yml @@ -15,7 +15,7 @@ jobs: - { python-version: 3.7, tox-env: py37-no-ext } - { python-version: 3.8, tox-env: py38-no-ext } - { python-version: 3.9, tox-env: py39-no-ext } - - { python-version: 3.10, tox-env: py39-no-ext } + - { python-version: 3.10, tox-env: py310-no-ext } - { python-version: pypy-3.7, tox-env: pypy37-no-ext } steps: From 0bc45b69fccfc6b419952407bbee1c2ff80b3bc2 Mon Sep 17 00:00:00 2001 From: Stephen Sadowski Date: Sun, 24 Oct 2021 17:08:06 -0500 Subject: [PATCH 3/5] updated tox.ini for py310 --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 5612f6ded7..609ceb48e6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ [tox] -envlist = py37, py38, py39, pyNightly, pypy37, {py37,py38,py39,pyNightly,pypy37}-no-ext, lint, check, security, docs, type-checking +envlist = py37, py38, py39, py310, pyNightly, pypy37, {py37,py38,py39,py310,pyNightly,pypy37}-no-ext, lint, check, security, docs, type-checking [testenv] usedevelop = true setenv = - {py37,py38,py39,pyNightly}-no-ext: SANIC_NO_UJSON=1 - {py37,py38,py39,pyNightly}-no-ext: SANIC_NO_UVLOOP=1 + {py37,py38,py39,py310,pyNightly}-no-ext: SANIC_NO_UJSON=1 + {py37,py38,py39,py310,pyNightly}-no-ext: SANIC_NO_UVLOOP=1 extras = test commands = pytest {posargs:tests --cov sanic} From 6e5d0b5a7f0a2b6693651b568f7926baf3bdd966 Mon Sep 17 00:00:00 2001 From: Stephen Sadowski Date: Sun, 24 Oct 2021 17:15:01 -0500 Subject: [PATCH 4/5] quoted the rest of the bare 3.10 references in the workflows --- .github/workflows/pr-bandit.yml | 2 +- .github/workflows/pr-type-check.yml | 2 +- .github/workflows/pr-windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-bandit.yml b/.github/workflows/pr-bandit.yml index cf4facd348..c90514e874 100644 --- a/.github/workflows/pr-bandit.yml +++ b/.github/workflows/pr-bandit.yml @@ -16,7 +16,7 @@ jobs: - { python-version: 3.7, tox-env: security} - { python-version: 3.8, tox-env: security} - { python-version: 3.9, tox-env: security} - - { python-version: 3.10, tox-env: security} + - { python-version: "3.10", tox-env: security} steps: - name: Checkout the repository uses: actions/checkout@v2 diff --git a/.github/workflows/pr-type-check.yml b/.github/workflows/pr-type-check.yml index 8f920f6bc9..80d8d9fadc 100644 --- a/.github/workflows/pr-type-check.yml +++ b/.github/workflows/pr-type-check.yml @@ -16,7 +16,7 @@ jobs: - { python-version: 3.7, tox-env: type-checking} - { python-version: 3.8, tox-env: type-checking} - { python-version: 3.9, tox-env: type-checking} - - { python-version: 3.10, tox-env: type-checking} + - { python-version: "3.10", tox-env: type-checking} steps: - name: Checkout the repository uses: actions/checkout@v2 diff --git a/.github/workflows/pr-windows.yml b/.github/workflows/pr-windows.yml index 4e31d775cc..73e29d4ff2 100644 --- a/.github/workflows/pr-windows.yml +++ b/.github/workflows/pr-windows.yml @@ -15,7 +15,7 @@ jobs: - { python-version: 3.7, tox-env: py37-no-ext } - { python-version: 3.8, tox-env: py38-no-ext } - { python-version: 3.9, tox-env: py39-no-ext } - - { python-version: 3.10, tox-env: py310-no-ext } + - { python-version: "3.10", tox-env: py310-no-ext } - { python-version: pypy-3.7, tox-env: pypy37-no-ext } steps: From eef1f02a9e2543e47107aac1ca3e5aa371c8d471 Mon Sep 17 00:00:00 2001 From: Stephen Sadowski Date: Sun, 24 Oct 2021 17:39:14 -0500 Subject: [PATCH 5/5] Issue with pytest requires version bump to 6.2.5 for python 3.10 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f9c23c14cf..f4644be531 100644 --- a/setup.py +++ b/setup.py @@ -95,7 +95,7 @@ def open_local(paths, mode="r", encoding="utf8"): tests_require = [ "sanic-testing>=0.7.0", - "pytest==5.2.1", + "pytest==6.2.5", "coverage==5.3", "gunicorn==20.0.4", "pytest-cov",