Skip to content

Commit

Permalink
tests: Generate some of the Web 1 tox entries with toxgen (#3980)
Browse files Browse the repository at this point in the history
- remove hardcoded entries for `flask`, `starlette` from the tox
template
- remove them from the ignore list in `populate_tox.py`
- run `populate_tox.py` to fill in entries for them
- run `split_gh_tox_actions.py` to generate the CI yaml files so that
they correspond to the new tox.ini

The remaining integrations in this group are not trivial to port to the
script, I'll do this step by step in follow-up PRs.

---------

Co-authored-by: Daniel Szoke <[email protected]>
  • Loading branch information
sentrivana and szokeasaurusrex authored Feb 13, 2025
1 parent feb642b commit 85879b4
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-web-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","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
Expand Down
23 changes: 23 additions & 0 deletions scripts/populate_tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
"clickhouse_driver": {
"package": "clickhouse-driver",
},
"flask": {
"package": "flask",
"deps": {
"*": ["flask-login", "werkzeug"],
"<2.0": ["werkzeug<2.1.0", "markupsafe<2.1.0"],
},
},
"gql": {
"package": "gql[all]",
},
Expand Down Expand Up @@ -47,6 +54,22 @@
"sqlalchemy": {
"package": "sqlalchemy",
},
"starlette": {
"package": "starlette",
"deps": {
"*": [
"pytest-asyncio",
"python-multipart",
"requests",
"anyio<4.0.0",
"jinja2",
"httpx",
],
"<0.37": ["httpx<0.28.0"],
"<0.15": ["jinja2<3.1"],
"py3.6": ["aiocontextvars"],
},
},
"statsig": {
"package": "statsig",
"deps": {
Expand Down
2 changes: 0 additions & 2 deletions scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"dramatiq",
"falcon",
"fastapi",
"flask",
"gcp",
"grpc",
"httpx",
Expand All @@ -88,7 +87,6 @@
"rq",
"sanic",
"spark",
"starlette",
"starlite",
"tornado",
}
Expand Down
40 changes: 0 additions & 40 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ envlist =
{py3.7,py3.10}-fastapi-v{0.79}
{py3.8,py3.12,py3.13}-fastapi-latest

# Flask
{py3.6,py3.8}-flask-v{1}
{py3.8,py3.11,py3.12}-flask-v{2}
{py3.10,py3.11,py3.12}-flask-v{3}
{py3.10,py3.12,py3.13}-flask-latest

# GCP
{py3.7}-gcp

Expand Down Expand Up @@ -222,12 +216,6 @@ envlist =
{py3.8,py3.10,py3.11}-spark-v{3.1,3.3,3.5}
{py3.8,py3.10,py3.11,py3.12}-spark-latest

# Starlette
{py3.7,py3.10}-starlette-v{0.19}
{py3.7,py3.11}-starlette-v{0.24,0.28}
{py3.8,py3.11,py3.12}-starlette-v{0.32,0.36,0.40}
{py3.8,py3.12,py3.13}-starlette-latest

# Starlite
{py3.8,py3.11}-starlite-v{1.48,1.51}
# 1.51.14 is the last starlite version; the project continues as litestar
Expand Down Expand Up @@ -410,16 +398,6 @@ deps =
fastapi-v{0.79}: fastapi~=0.79.0
fastapi-latest: fastapi
# Flask
flask: flask-login
flask-v{1,2.0}: Werkzeug<2.1.0
flask-v{1,2.0}: markupsafe<2.1.0
flask-v{3}: Werkzeug
flask-v1: Flask~=1.0
flask-v2: Flask~=2.0
flask-v3: Flask~=3.0
flask-latest: Flask
# gRPC
grpc: protobuf
grpc: mypy-protobuf
Expand Down Expand Up @@ -581,24 +559,6 @@ deps =
spark-v4.0: pyspark==4.0.0.dev2
spark-latest: pyspark
# Starlette
starlette: pytest-asyncio
starlette: python-multipart
starlette: requests
# (this is a dependency of httpx)
starlette: anyio<4.0.0
starlette: jinja2
starlette-v{0.19,0.24,0.28,0.32,0.36}: httpx<0.28.0
starlette-v0.40: httpx
starlette-latest: httpx
starlette-v0.19: starlette~=0.19.0
starlette-v0.24: starlette~=0.24.0
starlette-v0.28: starlette~=0.28.0
starlette-v0.32: starlette~=0.32.0
starlette-v0.36: starlette~=0.36.0
starlette-v0.40: starlette~=0.40.0
starlette-latest: starlette
# Starlite
starlite: pytest-asyncio
starlite: python-multipart
Expand Down
3 changes: 2 additions & 1 deletion sentry_sdk/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def iter_default_integrations(with_auto_enabling_integrations):
"dramatiq": (1, 9),
"falcon": (1, 4),
"fastapi": (0, 79, 0),
"flask": (0, 10),
"flask": (1, 1, 4),
"gql": (3, 4, 1),
"graphene": (3, 3),
"grpc": (1, 32, 0), # grpcio
Expand All @@ -151,6 +151,7 @@ def iter_default_integrations(with_auto_enabling_integrations):
"rq": (0, 6),
"sanic": (0, 8),
"sqlalchemy": (1, 2),
"starlette": (0, 16),
"starlite": (1, 48),
"statsig": (0, 55, 3),
"strawberry": (0, 209, 5),
Expand Down
82 changes: 40 additions & 42 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ envlist =
{py3.7,py3.10}-fastapi-v{0.79}
{py3.8,py3.12,py3.13}-fastapi-latest

# Flask
{py3.6,py3.8}-flask-v{1}
{py3.8,py3.11,py3.12}-flask-v{2}
{py3.10,py3.11,py3.12}-flask-v{3}
{py3.10,py3.12,py3.13}-flask-latest

# GCP
{py3.7}-gcp

Expand Down Expand Up @@ -222,12 +216,6 @@ envlist =
{py3.8,py3.10,py3.11}-spark-v{3.1,3.3,3.5}
{py3.8,py3.10,py3.11,py3.12}-spark-latest

# Starlette
{py3.7,py3.10}-starlette-v{0.19}
{py3.7,py3.11}-starlette-v{0.24,0.28}
{py3.8,py3.11,py3.12}-starlette-v{0.32,0.36,0.40}
{py3.8,py3.12,py3.13}-starlette-latest

# Starlite
{py3.8,py3.11}-starlite-v{1.48,1.51}
# 1.51.14 is the last starlite version; the project continues as litestar
Expand Down Expand Up @@ -288,7 +276,19 @@ envlist =
{py3.8,py3.10,py3.11}-strawberry-v0.209.8
{py3.8,py3.11,py3.12}-strawberry-v0.226.2
{py3.8,py3.11,py3.12}-strawberry-v0.243.1
{py3.9,py3.12,py3.13}-strawberry-v0.260.1
{py3.9,py3.12,py3.13}-strawberry-v0.260.2


# ~~~ Web 1 ~~~
{py3.6,py3.7,py3.8}-flask-v1.1.4
{py3.8,py3.12,py3.13}-flask-v2.3.3
{py3.8,py3.12,py3.13}-flask-v3.0.3
{py3.9,py3.12,py3.13}-flask-v3.1.0

{py3.6,py3.9,py3.10}-starlette-v0.16.0
{py3.7,py3.10,py3.11}-starlette-v0.26.1
{py3.8,py3.11,py3.12}-starlette-v0.36.3
{py3.9,py3.12,py3.13}-starlette-v0.45.3


# ~~~ Misc ~~~
Expand Down Expand Up @@ -463,16 +463,6 @@ deps =
fastapi-v{0.79}: fastapi~=0.79.0
fastapi-latest: fastapi

# Flask
flask: flask-login
flask-v{1,2.0}: Werkzeug<2.1.0
flask-v{1,2.0}: markupsafe<2.1.0
flask-v{3}: Werkzeug
flask-v1: Flask~=1.0
flask-v2: Flask~=2.0
flask-v3: Flask~=3.0
flask-latest: Flask

# gRPC
grpc: protobuf
grpc: mypy-protobuf
Expand Down Expand Up @@ -634,24 +624,6 @@ deps =
spark-v4.0: pyspark==4.0.0.dev2
spark-latest: pyspark

# Starlette
starlette: pytest-asyncio
starlette: python-multipart
starlette: requests
# (this is a dependency of httpx)
starlette: anyio<4.0.0
starlette: jinja2
starlette-v{0.19,0.24,0.28,0.32,0.36}: httpx<0.28.0
starlette-v0.40: httpx
starlette-latest: httpx
starlette-v0.19: starlette~=0.19.0
starlette-v0.24: starlette~=0.24.0
starlette-v0.28: starlette~=0.28.0
starlette-v0.32: starlette~=0.32.0
starlette-v0.36: starlette~=0.36.0
starlette-v0.40: starlette~=0.40.0
starlette-latest: starlette

# Starlite
starlite: pytest-asyncio
starlite: python-multipart
Expand Down Expand Up @@ -731,10 +703,36 @@ deps =
strawberry-v0.209.8: strawberry-graphql[fastapi,flask]==0.209.8
strawberry-v0.226.2: strawberry-graphql[fastapi,flask]==0.226.2
strawberry-v0.243.1: strawberry-graphql[fastapi,flask]==0.243.1
strawberry-v0.260.1: strawberry-graphql[fastapi,flask]==0.260.1
strawberry-v0.260.2: strawberry-graphql[fastapi,flask]==0.260.2
strawberry: httpx


# ~~~ Web 1 ~~~
flask-v1.1.4: flask==1.1.4
flask-v2.3.3: flask==2.3.3
flask-v3.0.3: flask==3.0.3
flask-v3.1.0: flask==3.1.0
flask: flask-login
flask: werkzeug
flask-v1.1.4: werkzeug<2.1.0
flask-v1.1.4: markupsafe<2.1.0

starlette-v0.16.0: starlette==0.16.0
starlette-v0.26.1: starlette==0.26.1
starlette-v0.36.3: starlette==0.36.3
starlette-v0.45.3: starlette==0.45.3
starlette: pytest-asyncio
starlette: python-multipart
starlette: requests
starlette: anyio<4.0.0
starlette: jinja2
starlette: httpx
starlette-v0.16.0: httpx<0.28.0
starlette-v0.26.1: httpx<0.28.0
starlette-v0.36.3: httpx<0.28.0
py3.6-starlette: aiocontextvars


# ~~~ Misc ~~~
loguru-v0.7.3: loguru==0.7.3

Expand Down

0 comments on commit 85879b4

Please sign in to comment.