Skip to content

Commit 42bd108

Browse files
committed
feat(ci): Add a CI test job for Python 3.10
1 parent 21eaaeb commit 42bd108

File tree

5 files changed

+83
-3
lines changed

5 files changed

+83
-3
lines changed

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,31 @@ jobs:
154154
. venv/bin/activate
155155
pytest -v
156156
157+
python310:
158+
docker:
159+
- image: circleci/python:3.10.0-buster
160+
- image: circleci/postgres:9.6.5-alpine-ram
161+
- image: circleci/mariadb:10-ram
162+
- image: circleci/redis:5.0.4
163+
- image: rabbitmq:3.5.4
164+
- image: circleci/mongo:4.2.3-ram
165+
- image: singularities/pubsub-emulator
166+
environment:
167+
PUBSUB_PROJECT_ID: "project-test"
168+
PUBSUB_LISTEN_ADDRESS: "0.0.0.0:8432"
169+
working_directory: ~/repo
170+
steps:
171+
- checkout
172+
- pip-install-deps:
173+
requirements: "tests/requirements-310.txt"
174+
- run:
175+
name: run tests
176+
environment:
177+
INSTANA_TEST: "true"
178+
command: |
179+
. venv/bin/activate
180+
pytest -v
181+
157182
py38couchbase:
158183
docker:
159184
- image: circleci/python:3.7.8-stretch
@@ -300,6 +325,7 @@ workflows:
300325
- python37
301326
- python38
302327
- python39
328+
- python310
303329
- py27cassandra
304330
- py36cassandra
305331
- py37asynqp

instana/collector/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def start(self):
102102
logger.debug("BaseCollector.start: launching collection thread")
103103
self.thread_shutdown.clear()
104104
self.reporting_thread = threading.Thread(target=self.thread_loop, args=())
105-
self.reporting_thread.setDaemon(True)
106-
self.reporting_thread.setName(self.THREAD_NAME)
105+
self.reporting_thread.daemon = True
106+
self.reporting_thread.name = self.THREAD_NAME
107107
self.reporting_thread.start()
108108
self.started = True
109109
else:

instana/instrumentation/logging.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
import logging
99
import collections
1010

11+
# TODO: Remove this alias once we don't have to support <=Python 3.3
12+
collections_abc = getattr(collections, 'abc', collections)
13+
Mapping = collections_abc.Mapping
14+
# End of alias
15+
1116
from ..log import logger
1217
from ..util.traceutils import get_active_tracer
1318

@@ -25,7 +30,7 @@ def log_with_instana(wrapped, instance, argv, kwargs):
2530

2631
msg = str(argv[1])
2732
args = argv[2]
28-
if args and len(args) == 1 and isinstance(args[0], collections.Mapping) and args[0]:
33+
if args and len(args) == 1 and isinstance(args[0], Mapping) and args[0]:
2934
args = args[0]
3035

3136
# get the formatted log message

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
if LooseVersion(sys.version) >= LooseVersion('3.7.0'):
3838
collect_ignore_glob.append("*test_sudsjurko*")
3939

40+
if LooseVersion(sys.version) >= LooseVersion('3.10.0'):
41+
collect_ignore_glob.append("*test_tornado*")
42+
collect_ignore_glob.append("*test_boto3_secretsmanager*")
43+
44+
4045
# Set our testing flags
4146
os.environ["INSTANA_TEST"] = "true"
4247
# os.environ["INSTANA_DEBUG"] = "true"

tests/requirements-310.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# pre 6.0 tornado would try to import 'MutableMapping' from 'collections'
2+
# directly, and in Python 3.10 that doesn't work anymore, so that would fail with:
3+
# venv/lib/python3.10/site-packages/tornado/httputil.py:107: in <module>
4+
# AttributeError: module 'collections' has no attribute 'MutableMapping'
5+
# An alternative would be to disable this in testconf:
6+
# collect_ignore_glob.append("*test_tornado*")
7+
tornado>=6.1
8+
9+
10+
aiofiles>=0.5.0
11+
aiohttp>=3.7.4
12+
boto3>=1.17.74
13+
celery>=5.0.5
14+
coverage>=5.5
15+
Django>=3.2.3
16+
fastapi>=0.65.1
17+
flask>=2.0.0
18+
markupsafe>=2.1.0
19+
grpcio>=1.37.1
20+
google-cloud-pubsub<=2.1.0
21+
google-cloud-storage>=1.24.0
22+
lxml>=4.6.3
23+
mock>=4.0.3
24+
25+
# We have to increase the minimum moto version so we can keep markupsafe on the required minimum
26+
moto>=2.0
27+
mysqlclient>=2.0.3
28+
nose>=1.3.7
29+
PyMySQL[rsa]>=1.0.2
30+
psycopg2-binary>=2.8.6
31+
pika>=1.2.0
32+
pymongo>=3.11.4
33+
pyramid>=2.0
34+
pytest>=6.2.4
35+
pytest-celery
36+
redis>=3.5.3
37+
requests-mock
38+
sanic>=19.0.0,<21.9.0
39+
sqlalchemy>=1.4.15
40+
spyne>=2.13.16
41+
suds-jurko>=0.6
42+
43+
uvicorn>=0.13.4
44+
urllib3[secure]!=1.25.0,!=1.25.1,<1.27,>=1.21.1

0 commit comments

Comments
 (0)