Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
64 changes: 49 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,33 @@ commands:
- store_artifacts:
path: htmlcov

install_librdkafka:
steps:
- run:
name: Instal pre-requirement to build confluent-kafka
command: |
mkdir -p /etc/apt/keyrings
wget -qO - https://packages.confluent.io/deb/8.1/archive.key | gpg --dearmor -o /etc/apt/keyrings/confluent.gpg
echo "Types: deb
URIs: https://packages.confluent.io/deb/8.3
Suites: stable
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/confluent.gpg

Types: deb
URIs: https://packages.confluent.io/clients/deb/
Suites: trixie
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/confluent.gpg" | tee /etc/apt/sources.list.d/confluent-platform.sources > /dev/null

- run:
name: Instal librdkafka
command: |
apt-get update
apt-get install -y --no-install-recommends build-essential python3-dev librdkafka-dev

jobs:
python3x:
parameters:
Expand Down Expand Up @@ -196,9 +223,9 @@ jobs:
- store-pytest-results
- store-coverage-report

py39gevent:
py312gevent:
docker:
- image: public.ecr.aws/docker/library/python:3.9
- image: public.ecr.aws/docker/library/python:3.12
working_directory: ~/repo
steps:
- checkout
Expand All @@ -214,9 +241,12 @@ jobs:
- store-pytest-results
- store-coverage-report

py312aws:
pyaws:
parameters:
py-version:
type: string
docker:
- image: public.ecr.aws/docker/library/python:3.12
- image: public.ecr.aws/docker/library/python:<<parameters.py-version>>
working_directory: ~/repo
steps:
- checkout
Expand All @@ -227,7 +257,7 @@ jobs:
- run-tests-with-coverage-report:
tests: "tests_aws"
- capture-installed-versions:
label: "aws"
label: "aws-<<parameters.py-version>>"
- store-pytest-results
- store-coverage-report

Expand Down Expand Up @@ -291,6 +321,7 @@ jobs:
steps:
- checkout
- check-if-tests-needed
- install_librdkafka
- pip-install-deps
- pip-install-tests-deps:
requirements: "tests/requirements-kafka.txt"
Expand Down Expand Up @@ -324,7 +355,7 @@ jobs:

final_job:
docker:
- image: public.ecr.aws/docker/library/python:3.13
- image: public.ecr.aws/docker/library/python:latest
working_directory: ~/repo
steps:
- checkout
Expand Down Expand Up @@ -354,23 +385,26 @@ workflows:
- python3x:
matrix:
parameters:
py-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
- py39gevent
- py312aws
py-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
- py312gevent
- pyaws:
matrix:
parameters:
py-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
- py312cassandra
- pykafka:
matrix:
parameters:
py-version: ["3.9", "3.12", "3.14"]
py-version: ["3.10", "3.12", "3.14", "3.15"]
- autowrapt:
matrix:
parameters:
py-version: ["3.11", "3.12", "3.13", "3.14"]
py-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
- final_job:
requires:
- python3x
- py39gevent
- py312aws
- py312gevent
- pyaws
- py312cassandra
- pykafka
- autowrapt
Expand All @@ -381,8 +415,8 @@ workflows:
- main
requires:
- python3x
- py39gevent
- py312aws
- py312gevent
- pyaws
- py312cassandra
- pykafka
- final_job
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ linter + test suite).

## Coding Style

- Python 3.9+ compatible code
- Python 3.10+ compatible code
- Follow PEP 8 style guidelines (enforced by Ruff)
- Include copyright headers in new files (see [Legal](#legal) section)
- Use type hints where appropriate
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Development Container
FROM public.ecr.aws/docker/library/python:3.14-slim
FROM public.ecr.aws/docker/library/python:3.15-slim

RUN apt-get -y -qq update && \
apt-get -y -qq upgrade && \
Expand Down
3 changes: 2 additions & 1 deletion bin/aws-lambda/build_and_publish_lambda_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@
"--zip-file",
aws_zip_filename,
"--compatible-runtimes",
"python3.9",
"python3.10",
"python3.11",
"python3.12",
"python3.13",
"python3.14",
"python3.15",
"--compatible-architectures",
"x86_64",
"arm64",
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dynamic = [
]
description = "Python Distributed Tracing & Metrics Sensor for Instana."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
license = "MIT"
keywords = [
"performance",
Expand All @@ -31,12 +31,12 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Topic :: System :: Monitoring",
Expand All @@ -47,7 +47,7 @@ dependencies = [
"autowrapt>=1.0",
"fysom>=2.1.2",
"requests>=2.6.0",
"urllib3>=1.26.5",
"urllib3>=2.7.0",
"opentelemetry-api>=1.27.0",
"opentelemetry-semantic-conventions>=0.48b0",
"typing_extensions>=4.12.2",
Expand Down Expand Up @@ -98,7 +98,7 @@ exclude_also = [

[tool.ruff]
# https://docs.astral.sh/ruff/configuration/
target-version = "py39"
target-version = "py310"
# In addition to the standard set of exclusions, omit all tests, plus a specific file.
extend-exclude = [".bob", "bin", ".github", ".circleci", ".tekton"]
preview = true
Expand Down
4 changes: 2 additions & 2 deletions src/instana/autoprofile/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def start(self, **kwargs: Dict[str, Any]) -> None:
return

try:
if not min_version(3, 9):
raise EnvironmentError("Supported Python versions: 3.9 or higher.")
if not min_version(3, 10):
raise EnvironmentError("Supported Python versions: 3.10 or higher.")

if platform.python_implementation() != "CPython":
raise EnvironmentError("Supported Python interpreter: CPython.")
Expand Down
42 changes: 8 additions & 34 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@

# ppc64le and s390x have limitations with some supported libraries.
if is_ppc64() or is_s390x():
collect_ignore_glob.extend(
[
"*test_google-cloud*",
"*test_pymongo*",
]
)
collect_ignore_glob.extend([
"*test_google-cloud*",
"*test_pymongo*",
])

if is_ppc64():
collect_ignore_glob.append("*test_grpcio*")
Expand All @@ -51,42 +49,18 @@
collect_ignore_glob.append("*test_couchbase*")

if not os.environ.get("GEVENT_TEST"):
collect_ignore_glob.extend(
[
"*test_gevent*",
]
)
collect_ignore_glob.extend([
"*test_gevent*",
])

if not os.environ.get("KAFKA_TEST"):
collect_ignore_glob.append("*kafka/test*")

# Currently asyncio and tornado_server depends on aiohttp and
# since aiohttp versions < 3.12.14 have vulnerability we skip the tests below
if sys.version_info < (3, 9):
collect_ignore_glob.extend(
[
"*test_aiohttp*",
"*test_asyncio*",
"*test_tornado_server*",
]
)

# Spyne does not support python > 3.12
if sys.version_info >= (3, 12):
# Currently Spyne does not support python > 3.12
collect_ignore_glob.append("*test_spyne*")


if sys.version_info >= (3, 15):
collect_ignore_glob.extend(
[
# Currently not installable dependencies because of 3.15 incompatibilities
"*test_fastapi*",
# Development version of Python always break logging tests, so we skip then
"*test_logging*",
]
)


@pytest.fixture(scope="session")
def celery_config():
return {
Expand Down
5 changes: 0 additions & 5 deletions tests/frameworks/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# (c) Copyright Instana Inc. 2020


import sys
from typing import Generator

import pytest
Expand Down Expand Up @@ -64,10 +63,6 @@ def assert_fastapi_otel_spans(
assert tags["http.response.status_code"] == http_status_code


@pytest.mark.skipif(
sys.version_info < (3, 10),
reason="FastAPI >= 0.115.0 (required for OTel span assertions) only supports Python 3.10+",
)
class TestFastAPI:
@pytest.fixture(autouse=True)
def _resource(self) -> Generator[None, None, None]:
Expand Down
49 changes: 0 additions & 49 deletions tests/requirements-pre315.txt

This file was deleted.

10 changes: 4 additions & 6 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements-minimal.txt
aioamqp>=0.15.0
aiofiles>=0.5.0
aiohttp>=3.12.14; python_version >= "3.9"
aiohttp>=3.12.14
aio-pika>=9.5.2
boto3>=1.17.74
bottle>=0.12.25
Expand All @@ -14,7 +14,7 @@ flask>=2.3.2
grpcio>=1.14.1
google-cloud-pubsub>=2.0.0
google-cloud-storage>=1.24.0
legacy-cgi>=2.6.1; python_version == "3.13"
legacy-cgi>=2.6.1; python_version >= "3.13"
lxml>=4.9.2
mock>=4.0.3
moto>=4.1.2
Expand All @@ -31,15 +31,13 @@ elasticsearch>=8.0.0
redis>=3.5.3
requests-mock
responses<=0.17.0
sanic<=24.6.0; python_version < "3.9"
sanic>=19.9.0; python_version >= "3.9"
sanic>=19.9.0
sanic-testing>=24.6.0
spyne>=2.14.0; python_version < "3.12"
sqlalchemy>=2.0.0
starlette>=0.38.2; python_version == "3.13"
starlette>=0.38.2; python_version >= "3.13"
tornado>=6.4.1
twisted>=24.3.0
tracerite<=1.1.1; python_version < "3.9"
uvicorn>=0.13.4
urllib3>=1.26.5
httpx>=0.27.0
Expand Down
4 changes: 2 additions & 2 deletions tests_aws/01_lambda/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import pytest

os.environ["AWS_EXECUTION_ENV"] = "AWS_Lambda_python_3.10"
os.environ["AWS_EXECUTION_ENV"] = "AWS_Lambda_python_3.11"

from instana.collector.base import BaseCollector

if sys.version_info <= (3, 8):
if sys.version_info <= (3, 11):
print("Python runtime version not supported by AWS Lambda.")
exit(1)

Expand Down
Loading