Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
95 changes: 0 additions & 95 deletions .github/workflows/test-integrations-web-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,101 +22,6 @@ env:
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless
jobs:
test-web_2-latest:
name: Web 2 (latest)
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9","3.12","3.13"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-22.04]
# Use Docker container only for Python 3.6
container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }}
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v6
if: ${{ matrix.python-version != '3.6' }}
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Setup Test Env
run: |
pip install "coverage[toml]" tox
- name: Erase coverage
run: |
coverage erase
- name: Test aiohttp latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-aiohttp-latest"
- name: Test asgi latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-asgi-latest"
- name: Test bottle latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-bottle-latest"
- name: Test falcon latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-falcon-latest"
- name: Test litestar latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-litestar-latest"
- name: Test pyramid latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-pyramid-latest"
- name: Test quart latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-quart-latest"
- name: Test sanic latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-sanic-latest"
- name: Test starlite latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-starlite-latest"
- name: Test tornado latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-tornado-latest"
- name: Generate coverage XML (Python 3.6)
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
run: |
export COVERAGE_RCFILE=.coveragerc36
coverage combine .coverage-sentry-*
coverage xml --ignore-errors
- name: Generate coverage XML
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
run: |
coverage combine .coverage-sentry-*
coverage xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
# make sure no plugins alter our coverage reports
plugins: noop
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: .junitxml
verbose: true
test-web_2-pinned:
name: Web 2 (pinned)
timeout-minutes: 30
Expand Down
9 changes: 9 additions & 0 deletions scripts/populate_tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@
"requests": {
"package": "requests",
},
"sanic": {
"package": "sanic",
"deps": {
"*": ["websockets<11.0", "aiohttp"],
">=22": ["sanic-testing"],
"py3.6": ["aiocontextvars==0.2.1"],
"py3.8": ["tracerite<1.1.2"],
},
},
"spark": {
"package": "pyspark",
"python": ">=3.8",
Expand Down
46 changes: 29 additions & 17 deletions scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"redis",
"requests",
"rq",
"sanic",
}


Expand Down Expand Up @@ -263,8 +262,9 @@ def pick_releases_to_test(
) -> list[Version]:
"""Pick a handful of releases to test from a sorted list of supported releases."""
# If the package has majors (or major-like releases, even if they don't do
# semver), we want to make sure we're testing them all. If not, we just pick
# the oldest, the newest, and a couple in between.
# semver), we want to make sure we're testing them all (unless there's too
# many). If not, we just pick the oldest, the newest, and a couple
# in between.
#
# If there is a relevant prerelease, also test that in addition to the above.
has_majors = len(set([v.major for v in releases])) > 1
Expand All @@ -284,22 +284,23 @@ def pick_releases_to_test(
if release > releases_by_major[release.major][1]:
releases_by_major[release.major][1] = release

for i, (min_version, max_version) in enumerate(releases_by_major.values()):
filtered_releases.add(max_version)
if i == len(releases_by_major) - 1:
# If this is the latest major release, also check the lowest
# version of this version
filtered_releases.add(min_version)
if len(releases_by_major) > 5:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of a heuristic, should we explicitly add a "calver": True field in the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm that's maybe a bit too specific but maybe a key with a numerical value to define how many versions should be tested? That could then be also used for some of the smaller integrations to test less versions since now it's a bit of an overkill for some

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add smth 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, see #4767 (comment)

# This framework has a lot of majors (maybe calver?). Pick a selection.
releases = sorted(
[max_version for (_, max_version) in releases_by_major.values()]
)
filtered_releases = _pick_releases(releases)

else:
for i, (min_version, max_version) in enumerate(releases_by_major.values()):
filtered_releases.add(max_version)
if i == len(releases_by_major) - 1:
# If this is the latest major release, also check the lowest
# version of this version
filtered_releases.add(min_version)

else:
filtered_releases = {
releases[0], # oldest version supported
releases[len(releases) // 3],
releases[
len(releases) // 3 * 2
], # two releases in between, roughly evenly spaced
releases[-1], # latest
}
filtered_releases = _pick_releases(releases)

filtered_releases = sorted(filtered_releases)
if last_prerelease is not None:
Expand All @@ -308,6 +309,17 @@ def pick_releases_to_test(
return filtered_releases


def _pick_releases(releases: list[Version]) -> list[Version]:
return {
releases[0], # oldest version supported
releases[len(releases) // 3],
releases[
len(releases) // 3 * 2
], # two releases in between, roughly evenly spaced
releases[-1], # latest
}


def supported_python_versions(
package_python_versions: Union[SpecifierSet, list[Version]],
custom_supported_versions: Optional[SpecifierSet] = None,
Expand Down
18 changes: 0 additions & 18 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ envlist =
{py3.7,py3.11,py3.12}-rq-v{1.15,1.16}
{py3.7,py3.12,py3.13}-rq-latest

# Sanic
{py3.6,py3.7}-sanic-v{0.8}
{py3.6,py3.8}-sanic-v{20}
{py3.8,py3.11,py3.12}-sanic-v{24.6}
{py3.9,py3.12,py3.13}-sanic-latest

# === Integrations - Auto-generated ===
# These come from the populate_tox.py script. Eventually we should move all
# integration tests there.
Expand Down Expand Up @@ -216,18 +210,6 @@ deps =
rq-v1.16: rq~=1.16.0
rq-latest: rq

# Sanic
sanic: websockets<11.0
sanic: aiohttp
sanic-v{24.6}: sanic_testing
sanic-latest: sanic_testing
{py3.6}-sanic: aiocontextvars==0.2.1
{py3.8}-sanic: tracerite<1.1.2
sanic-v0.8: sanic~=0.8.0
sanic-v20: sanic~=20.0
sanic-v24.6: sanic~=24.6.0
sanic-latest: sanic

# === Integrations - Auto-generated ===
# These come from the populate_tox.py script. Eventually we should move all
# integration tests there.
Expand Down
36 changes: 17 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# The file (and all resulting CI YAMLs) then need to be regenerated via
# "scripts/generate-test-files.sh".
#
# Last generated: 2025-09-17T07:20:17.058541+00:00
# Last generated: 2025-09-17T12:09:36.328956+00:00

[tox]
requires =
Expand Down Expand Up @@ -84,12 +84,6 @@ envlist =
{py3.7,py3.11,py3.12}-rq-v{1.15,1.16}
{py3.7,py3.12,py3.13}-rq-latest

# Sanic
{py3.6,py3.7}-sanic-v{0.8}
{py3.6,py3.8}-sanic-v{20}
{py3.8,py3.11,py3.12}-sanic-v{24.6}
{py3.9,py3.12,py3.13}-sanic-latest

# === Integrations - Auto-generated ===
# These come from the populate_tox.py script. Eventually we should move all
# integration tests there.
Expand Down Expand Up @@ -303,6 +297,11 @@ envlist =
{py3.7,py3.10,py3.11}-quart-v0.18.4
{py3.9,py3.12,py3.13}-quart-v0.20.0

{py3.6}-sanic-v0.8.3
{py3.6,py3.8,py3.9}-sanic-v20.12.7
{py3.8,py3.10,py3.11}-sanic-v23.12.2
{py3.9,py3.12,py3.13}-sanic-v25.3.0

{py3.8,py3.10,py3.11}-starlite-v1.48.1
{py3.8,py3.10,py3.11}-starlite-v1.49.0
{py3.8,py3.10,py3.11}-starlite-v1.50.2
Expand Down Expand Up @@ -441,18 +440,6 @@ deps =
rq-v1.16: rq~=1.16.0
rq-latest: rq

# Sanic
sanic: websockets<11.0
sanic: aiohttp
sanic-v{24.6}: sanic_testing
sanic-latest: sanic_testing
{py3.6}-sanic: aiocontextvars==0.2.1
{py3.8}-sanic: tracerite<1.1.2
sanic-v0.8: sanic~=0.8.0
sanic-v20: sanic~=20.0
sanic-v24.6: sanic~=24.6.0
sanic-latest: sanic

# === Integrations - Auto-generated ===
# These come from the populate_tox.py script. Eventually we should move all
# integration tests there.
Expand Down Expand Up @@ -785,6 +772,17 @@ deps =
quart-v0.18.4: hypercorn<0.15.0
{py3.8}-quart: taskgroup==0.0.0a4

sanic-v0.8.3: sanic==0.8.3
sanic-v20.12.7: sanic==20.12.7
sanic-v23.12.2: sanic==23.12.2
sanic-v25.3.0: sanic==25.3.0
sanic: websockets<11.0
sanic: aiohttp
sanic-v23.12.2: sanic-testing
sanic-v25.3.0: sanic-testing
{py3.6}-sanic: aiocontextvars==0.2.1
{py3.8}-sanic: tracerite<1.1.2

starlite-v1.48.1: starlite==1.48.1
starlite-v1.49.0: starlite==1.49.0
starlite-v1.50.2: starlite==1.50.2
Expand Down