Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Jan 9, 2025
1 parent 1883f67 commit 49c914e
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.8"]
python-version: ["3.9"]
# 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
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.11","3.12","3.13"]
python-version: ["3.6","3.7","3.8","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
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- master
- release/**
- sentry-sdk-2.0
- potel-base
pull_request:
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
Expand Down
120 changes: 101 additions & 19 deletions scripts/populate_tox/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"pytest-aiohttp",
"pytest-asyncio",
],
# XXX anthropic-v{0.16,0.28}: httpx<0.28.0
"anthropic": [
"anthropic",
"httpx", # TODO has an upper bound anthropic-v{0.16,0.28}: httpx<0.28.0
"pytest-asyncio",
],
"ariadne": [
Expand All @@ -21,9 +21,9 @@
"flask",
"httpx",
],
# XXX arq-v0.23: pydantic<2
"arq": [
"arq",
"pydantic", # TODO arq-v0.23: pydantic<2
"fakeredis>=2.2.0,<2.8",
"pytest-asyncio",
"async-timeout",
Expand All @@ -32,20 +32,19 @@
"asyncpg",
"pytest-asyncio",
],
"aws_lambda": [
"boto3",
"beam": [
"apache-beam",
],
"beam": ["apache-beam"],
"boto3": [
"boto3",
],
"bottle": [
"bottle",
"werkzeug<2.1.0",
],
# XXX {py3.7}-celery: importlib-metadata<5.0
"celery": [
"celery",
"importlib-metadata", # {py3.7}-celery: importlib-metadata<5.0
"newrelic",
"redis",
],
Expand All @@ -59,15 +58,31 @@
"cohere": [
"cohere",
],
# XXX
# django: psycopg2-binary
# django-v{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: djangorestframework>=3.0.0,<4.0.0
# django-v{2.0,2.2,3.0,3.2,4.0,4.1,4.2,5.0,5.1}: channels[daphne]
# django-v{2.2,3.0}: six
# django-v{1.11,2.0,2.2,3.0,3.2}: Werkzeug<2.1.0
# django-v{1.11,2.0,2.2,3.0}: pytest-django<4.0
# django-v{3.2,4.0,4.1,4.2,5.0,5.1}: pytest-django
# django-v{4.0,4.1,4.2,5.0,5.1}: djangorestframework
# django-v{4.0,4.1,4.2,5.0,5.1}: pytest-asyncio
# django-v{4.0,4.1,4.2,5.0,5.1}: Werkzeug
# django-latest: djangorestframework
# django-latest: pytest-asyncio
# django-latest: pytest-django
# django-latest: Werkzeug
# django-latest: channels[daphne]
"django": [
"django",
"channels[daphne]", # django-v{2.0,2.2,3.0,3.2,4.0,4.1,4.2,5.0,5.1}: channels[daphne]
"djangorestframework", # django-v{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: djangorestframework>=3.0.0,<4.0.0
"channels[daphne]",
"djangorestframework",
"psycopg2-binary",
"pytest-asyncio",
"pytest-django", # django-v{1.11,2.0,2.2,3.0}: pytest-django<4.0
"six", # django-v{2.2,3.0}: six
"werkzeug", # django-v{1.11,2.0,2.2,3.0,3.2}: Werkzeug<2.1.0
"pytest-django",
"six",
"werkzeug",
],
"dramatiq": [
"dramatiq",
Expand All @@ -83,11 +98,13 @@
"pytest-asyncio",
"requests",
],
# XXX
# flask-v{1,2.0}: Werkzeug<2.1.0
# flask-v{1,2.0}: markupsafe<2.1.0
"flask": [
"flask",
"flask-login",
"werkzeug", # flask-v{1,2.0}: Werkzeug<2.1.0
"markupsafe", # flask-v{1,2.0}: markupsafe<2.1.0
"werkzeug",
],
"gql": [
"gql[all]",
Expand All @@ -106,6 +123,17 @@
"types-protobuf",
"pytest-asyncio",
],
# XXX
# httpx-v0.16: pytest-httpx==0.10.0
# httpx-v0.18: pytest-httpx==0.12.0
# httpx-v0.20: pytest-httpx==0.14.0
# httpx-v0.22: pytest-httpx==0.19.0
# httpx-v0.23: pytest-httpx==0.21.0
# httpx-v0.24: pytest-httpx==0.22.0
# httpx-v0.25: pytest-httpx==0.25.0
# httpx: pytest-httpx
# anyio is a dep of httpx
# httpx: anyio<4.0.0
"httpx": [
"httpx",
"anyio<4.0.0",
Expand All @@ -116,6 +144,19 @@
"huggingface_hub": [
"huggingface_hub",
],
# XXX
# langchain-v0.1: openai~=1.0.0
# langchain-v0.1: langchain~=0.1.11
# langchain-v0.1: tiktoken~=0.6.0
# langchain-v0.1: httpx<0.28.0
# langchain-v0.3: langchain~=0.3.0
# langchain-v0.3: langchain-community
# langchain-v0.3: tiktoken
# langchain-v0.3: openai
# langchain-{latest,notiktoken}: langchain
# langchain-{latest,notiktoken}: langchain-openai
# langchain-{latest,notiktoken}: openai>=1.6.1
# langchain-latest: tiktoken~=0.6.0
"langchain": [
"langchain",
"langchain-community",
Expand All @@ -128,17 +169,29 @@
"langchain-openai",
"openai",
],
# litestar-v{2.0,2.6}: httpx<0.28
"litestar": [
"litestar",
"pytest-asyncio",
"python-multipart",
"requests",
"cryptography",
"httpx",
],
"loguru": [
"loguru",
],
# XXX
# openai-v1.0: openai~=1.0.0
# openai-v1.0: tiktoken
# openai-v1.0: httpx<0.28.0
# openai-v1.22: openai~=1.22.0
# openai-v1.22: tiktoken
# openai-v1.22: httpx<0.28.0
# openai-v1.55: openai~=1.55.0
# openai-v1.55: tiktoken
# openai-latest: openai
# openai-latest: tiktoken~=0.6.0
# openai-notiktoken: openai
"openai": [
"openai",
"pytest-asyncio",
Expand Down Expand Up @@ -169,34 +222,55 @@
"pyramid",
"werkzeug<2.1.0",
],
# XXX
# quart-v0.16: blinker<1.6
# quart-v0.16: jinja2<3.1.0
# quart-v0.16: Werkzeug<2.1.0
# quart-v0.16: hypercorn<0.15.0
# quart-v0.16: quart~=0.16.0
# quart-v0.19: Werkzeug>=3.0.0
# quart-v0.19: quart~=0.19.0
# {py3.8}-quart: taskgroup==0.0.0a4
"quart": [
"quart",
"quart-auth",
"pytest-asyncio",
"blinker",
"jinja2",
"hypercorn",
"taskgroup",
],
"ray": [
"ray",
],
# XXX
# {py3.6,py3.7}-redis: fakeredis!=2.26.0 # https://github.com/cunla/fakeredis-py/issues/341
"redis": [
"redis",
"fakeredis",
"fakeredis!=1.7.4",
"pytest<8.0.0",
"pytest-asyncio",
],
"redis-py-cluster-legacy": [
"redis-py-cluster",
],
# XXX requests: requests>=2.0
"requests": [
"requests",
],
# XXX
# https://github.com/jamesls/fakeredis/issues/245
# rq-v{0.6}: fakeredis<1.0
# rq-v{0.6}: redis<3.2.2
# rq-v{0.13,1.0,1.5,1.10}: fakeredis>=1.0,<1.7.4
# rq-v{1.15,1.16}: fakeredis
# {py3.6,py3.7}-rq-v{1.15,1.16}: fakeredis!=2.26.0 # https://github.com/cunla/fakeredis-py/issues/341
# rq-latest: fakeredis
# {py3.6,py3.7}-rq-latest: fakeredis!=2.26.0 # https://github.com/cunla/fakeredis-py/issues/341
"rq": [
"rq",
"fakeredis",
],
# XXX
# sanic-v{22,23}: sanic_testing
# sanic-latest: sanic_testing
# {py3.6}-sanic: aiocontextvars==0.2.1
"sanic": [
"sanic",
"websockets<11.0",
Expand All @@ -207,6 +281,8 @@
"spark": [
"pyspark",
],
# XXX
# starlette-v{0.19,0.24,0.28,0.32,0.36}: httpx<0.28.0
"starlette": [
"starlette",
"pytest-asyncio",
Expand Down Expand Up @@ -234,10 +310,16 @@
"flask",
"httpx",
],
# XXX
# Tornado <6.4.1 is incompatible with Pytest ≥8.2
# See https://github.com/tornadoweb/tornado/pull/3382.
# tornado-{v6.0,v6.2}: pytest<8.2
"tornado": [
"tornado",
"pytest",
],
# XXX
# trytond-v4: werkzeug<1.0
"trytond": [
"trytond",
"werkzeug",
Expand Down
14 changes: 7 additions & 7 deletions scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# - allow to specify version dependent dependencies
# - (optional) use a proper version parser for requires_python
# - (optional) order by alphabet, not group then alphabet
# - clean up the hardcoded stuff in tox.ini
# - fix otel (since it only has prereleases)
# - better picking of releases (e.g., if multiple majors, pick from each, etc.)

# Only consider package versions going back this far
CUTOFF = datetime.now() - timedelta(days=365 * 5)
Expand All @@ -32,8 +35,6 @@
PYPI_VERSION_URL = "https://pypi.python.org/pypi/{project}/{version}/json"
CLASSIFIER_PREFIX = "Programming Language :: Python :: "

INTEGRATIONS_MIN_VERSIONS = {}

GROUPS = {
"Common": [
"common",
Expand Down Expand Up @@ -124,12 +125,13 @@
IGNORE = {
# Do not try auto-generating the tox entries for these. They will be
# hardcoded in tox.ini.
"common",
"gevent",
"asgi",
"aws_lambda",
"cloud_resource_context",
"potel",
"common",
"gcp",
"gevent",
"potel",
}

packages = {}
Expand Down Expand Up @@ -394,8 +396,6 @@ def write_tox_file(packages: dict) -> None:
f"The SDK supports Python versions {LOWEST_SUPPORTED_PYTHON_VERSION} to {HIGHEST_SUPPORTED_PYTHON_VERSION}."
)

print(INTEGRATIONS_MIN_VERSIONS)

packages = defaultdict(list)

for group, integrations in GROUPS.items():
Expand Down
9 changes: 9 additions & 0 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ envlist =
# OpenTelemetry Experimental (POTel)
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel

# AWS Lambda
# The aws_lambda tests deploy to the real AWS and have their own
# matrix of Python versions to run the test lambda function in.
# see `lambda_runtime` fixture in tests/integrations/aws_lambda.py
{py3.9}-aws_lambda

# === Integrations ===
{% for group, integrations in groups.items() %}
# ~~~ {{ group }} ~~~
Expand Down Expand Up @@ -76,6 +82,9 @@ deps =
# OpenTelemetry Experimental (POTel)
potel: -e .[opentelemetry-experimental]
# AWS Lambda
aws_lambda: boto3
# === Integrations ===
{% for group, integrations in groups.items() %}
# ~~~ {{ group }} ~~~
Expand Down
Loading

0 comments on commit 49c914e

Please sign in to comment.