Skip to content

Commit dffbb5f

Browse files
cedriczielPeter Giacomo Lombardo
andauthored
Add initial peek into python 3.9 (#274)
* Add initial peek into python 3.9 This adds a Circle CI job for Python 3.9 on Buster (not Stretch) CircleCI does not offer a stable 3.9.0 image, yet and RC2 should resemble the final thing until the stable image arrived. * Update to latest circleci/python:3.9.0 image * Switch to requirements.txt files for tests * Install from .txt requirements * Version limit asynqp * Use commands in CircleCI config * Fix syntax errors * Cleanup 2.7 test runs * Fix Python version Co-authored-by: Peter Giacomo Lombardo <[email protected]>
1 parent 6e106a8 commit dffbb5f

File tree

10 files changed

+141
-138
lines changed

10 files changed

+141
-138
lines changed

.circleci/config.yml

Lines changed: 87 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,55 @@
1-
# Python CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-python/ for more details
4-
#
5-
version: 2
1+
version: 2.1
2+
3+
# More about orbs: https://circleci.com/docs/2.0/using-orbs/
4+
# orbs:
5+
# ruby: circleci/[email protected]
6+
7+
commands:
8+
pip-install-deps-27:
9+
parameters:
10+
requirements:
11+
default: "tests/requirements.txt"
12+
type: string
13+
steps:
14+
- run:
15+
name: Install Python 2.7 Dependencies
16+
command: |
17+
rm -rf venv
18+
export PATH=/home/circleci/.local/bin:$PATH
19+
pip install --user -U pip setuptools virtualenv wheel
20+
virtualenv --python=python2.7 --always-copy venv
21+
. venv/bin/activate
22+
pip install 'wheel>=0.29.0'
23+
pip install -r requirements.txt
24+
pip install -r <<parameters.requirements>>
25+
26+
pip-install-deps:
27+
parameters:
28+
requirements:
29+
default: "tests/requirements.txt"
30+
type: string
31+
steps:
32+
- run:
33+
name: Install Python Dependencies
34+
command: |
35+
python -m venv venv
36+
. venv/bin/activate
37+
pip install 'wheel>=0.29.0'
38+
pip install -r requirements.txt
39+
pip install -r <<parameters.requirements>>
40+
41+
install-couchbase-deps:
42+
steps:
43+
- run:
44+
name: Install Couchbase Dependencies
45+
command: |
46+
sudo apt-get update
47+
sudo apt install lsb-release -y
48+
curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb
49+
sudo dpkg -i ./couchbase-release-1.0-6-amd64.deb
50+
sudo apt-get update
51+
sudo apt install libcouchbase-dev -y
52+
653
jobs:
754
python27:
855
docker:
@@ -15,17 +62,7 @@ jobs:
1562
working_directory: ~/repo
1663
steps:
1764
- checkout
18-
- run:
19-
name: install dependencies
20-
command: |
21-
rm -rf venv
22-
export PATH=/home/circleci/.local/bin:$PATH
23-
pip install --user -U pip setuptools virtualenv
24-
virtualenv --python=python2.7 --always-copy venv
25-
. venv/bin/activate
26-
pip install -U pip
27-
python setup.py install_egg_info
28-
pip install -e '.[test]'
65+
- pip-install-deps-27
2966
- run:
3067
name: run tests
3168
environment:
@@ -36,7 +73,7 @@ jobs:
3673
3774
python38:
3875
docker:
39-
- image: circleci/python:3.7.8-stretch
76+
- image: circleci/python:3.8.6
4077
- image: circleci/postgres:9.6.5-alpine-ram
4178
- image: circleci/mariadb:10-ram
4279
- image: circleci/redis:5.0.4
@@ -45,14 +82,27 @@ jobs:
4582
working_directory: ~/repo
4683
steps:
4784
- checkout
85+
- pip-install-deps
4886
- run:
49-
name: install dependencies
87+
name: run tests
88+
environment:
89+
INSTANA_TEST: "true"
5090
command: |
51-
python -m venv venv
5291
. venv/bin/activate
53-
pip install -U pip
54-
python setup.py install_egg_info
55-
pip install -e '.[test]'
92+
pytest -v
93+
94+
python39:
95+
docker:
96+
- image: circleci/python:3.9.0-buster
97+
- image: circleci/postgres:9.6.5-alpine-ram
98+
- image: circleci/mariadb:10-ram
99+
- image: circleci/redis:5.0.4
100+
- image: rabbitmq:3.5.4
101+
- image: circleci/mongo:4.2.3-ram
102+
working_directory: ~/repo
103+
steps:
104+
- checkout
105+
- pip-install-deps
56106
- run:
57107
name: run tests
58108
environment:
@@ -68,20 +118,9 @@ jobs:
68118
working_directory: ~/repo
69119
steps:
70120
- checkout
71-
- run:
72-
name: install dependencies
73-
command: |
74-
sudo apt-get update
75-
sudo apt install lsb-release -y
76-
curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb
77-
sudo dpkg -i ./couchbase-release-1.0-6-amd64.deb
78-
sudo apt-get update
79-
sudo apt install libcouchbase-dev -y
80-
python -m venv venv
81-
. venv/bin/activate
82-
pip install -U pip
83-
python setup.py install_egg_info
84-
pip install -e '.[test-couchbase]'
121+
- install-couchbase-deps
122+
- pip-install-deps:
123+
requirements: "tests/requirements-couchbase.txt"
85124
- run:
86125
name: run tests
87126
environment:
@@ -98,20 +137,9 @@ jobs:
98137
working_directory: ~/repo
99138
steps:
100139
- checkout
101-
- run:
102-
name: install dependencies
103-
command: |
104-
sudo apt-get update
105-
sudo apt install lsb-release -y
106-
curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb
107-
sudo dpkg -i ./couchbase-release-1.0-6-amd64.deb
108-
sudo apt-get update
109-
sudo apt install libcouchbase-dev -y
110-
python -m venv venv
111-
. venv/bin/activate
112-
pip install -U pip
113-
python setup.py install_egg_info
114-
pip install -e '.[test-couchbase]'
140+
- install-couchbase-deps
141+
- pip-install-deps-27:
142+
requirements: "tests/requirements-couchbase.txt"
115143
- run:
116144
name: run tests
117145
environment:
@@ -131,17 +159,9 @@ jobs:
131159
working_directory: ~/repo
132160
steps:
133161
- checkout
134-
- run:
135-
name: install dependencies
136-
command: |
137-
rm -rf venv
138-
export PATH=/home/circleci/.local/bin:$PATH
139-
pip install --user -U pip setuptools virtualenv
140-
virtualenv --python=python2.7 --always-copy venv
141-
. venv/bin/activate
142-
pip install -U pip
143-
python setup.py install_egg_info
144-
pip install -e '.[test-cassandra]'
162+
- install-couchbase-deps
163+
- pip-install-deps-27:
164+
requirements: "tests/requirements-cassandra.txt"
145165
- run:
146166
name: run tests
147167
environment:
@@ -161,14 +181,8 @@ jobs:
161181
working_directory: ~/repo
162182
steps:
163183
- checkout
164-
- run:
165-
name: install dependencies
166-
command: |
167-
python -m venv venv
168-
. venv/bin/activate
169-
pip install -U pip
170-
python setup.py install_egg_info
171-
pip install -e '.[test-cassandra]'
184+
- pip-install-deps:
185+
requirements: "tests/requirements-cassandra.txt"
172186
- run:
173187
name: run tests
174188
environment:
@@ -184,14 +198,8 @@ jobs:
184198
working_directory: ~/repo
185199
steps:
186200
- checkout
187-
- run:
188-
name: install dependencies
189-
command: |
190-
python -m venv venv
191-
. venv/bin/activate
192-
pip install -U pip
193-
python setup.py install_egg_info
194-
pip install -e '.[test-gevent]'
201+
- pip-install-deps:
202+
requirements: "tests/requirements-gevent.txt"
195203
- run:
196204
name: run tests
197205
environment:
@@ -200,12 +208,14 @@ jobs:
200208
command: |
201209
. venv/bin/activate
202210
pytest -v tests/frameworks/test_gevent.py
211+
203212
workflows:
204213
version: 2
205214
build:
206215
jobs:
207216
- python27
208217
- python38
218+
- python39
209219
- py27cassandra
210220
- py36cassandra
211221
- gevent38

instana/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ def boot_agent():
133133
from .instrumentation import asyncio
134134
from .instrumentation.aiohttp import client
135135
from .instrumentation.aiohttp import server
136-
from .instrumentation import asynqp
137136
from .instrumentation import boto3_inst
138137

138+
if sys.version_info >= (3, 5, 3) and sys.version_info < (3, 8, 0):
139+
from .instrumentation import asynqp
140+
139141
if sys.version_info[0] < 3:
140142
from .instrumentation import mysqlpython
141143
from .instrumentation import webapp2_inst

requirements-test.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,61 +71,6 @@ def check_setuptools():
7171
'django': ['string = instana:load'], # deprecated: use same as 'instana'
7272
'django19': ['string = instana:load'], # deprecated: use same as 'instana'
7373
},
74-
extras_require={
75-
'test-gevent': [
76-
'flask>=0.12.2',
77-
'gevent>=1.4.0',
78-
'mock>=2.0.0',
79-
'nose>=1.0',
80-
'pyramid>=1.2',
81-
'pytest>=4.6',
82-
'urllib3[secure]!=1.25.0,!=1.25.1,<1.26,>=1.21.1'
83-
],
84-
'test-cassandra': [
85-
'cassandra-driver==3.20.2',
86-
'mock>=2.0.0',
87-
'nose>=1.0',
88-
'pytest>=4.6',
89-
'urllib3[secure]!=1.25.0,!=1.25.1,<1.26,>=1.21.1'
90-
],
91-
'test-couchbase': [
92-
'couchbase==2.5.9',
93-
],
94-
'test': [
95-
'aiofiles>=0.5.0;python_version>="3.5"',
96-
'aiohttp>=3.5.4;python_version>="3.5"',
97-
'asynqp>=0.4;python_version>="3.5"',
98-
'boto3>=1.10.0',
99-
'celery>=4.1.1',
100-
'django>=1.11,<2.2',
101-
'fastapi>=0.61.1;python_version>="3.6"',
102-
'flask>=0.12.2',
103-
'grpcio>=1.18.0',
104-
'google-cloud-storage>=1.24.0;python_version>="3.5"',
105-
'lxml>=3.4',
106-
'mock>=2.0.0',
107-
'moto>=1.3.16',
108-
'mysqlclient>=1.3.14;python_version>="3.5"',
109-
'MySQL-python>=1.2.5;python_version<="2.7"',
110-
'nose>=1.0',
111-
'PyMySQL[rsa]>=0.9.1',
112-
'pyOpenSSL>=16.1.0;python_version<="2.7"',
113-
'psycopg2>=2.7.1',
114-
'pymongo>=3.7.0',
115-
'pyramid>=1.2',
116-
'pytest>=4.6',
117-
'pytest-celery',
118-
'redis>3.0.0',
119-
'requests>=2.17.1',
120-
'sqlalchemy>=1.1.15',
121-
'spyne>=2.9,<=2.12.14',
122-
'suds-jurko>=0.6',
123-
'tornado>=4.5.3,<6.0',
124-
'uvicorn>=0.12.2;python_version>="3.6"',
125-
'urllib3[secure]!=1.25.0,!=1.25.1,<1.26,>=1.21.1'
126-
],
127-
},
128-
test_suite='nose.collector',
12974
keywords=['performance', 'opentracing', 'metrics', 'monitoring',
13075
'tracing', 'distributed-tracing'],
13176
classifiers=[

tests/clients/test_asynqp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
else:
2121
rabbitmq_host = "localhost"
2222

23-
#@pytest.mark.skipif(LooseVersion(sys.version) < LooseVersion('3.5.3'), reason="")
24-
@pytest.mark.skip("FIXME: Abandoned asynqp is now causing issues in later Python versions.")
23+
is_unsupported_version = LooseVersion(sys.version) < LooseVersion('3.5.3') \
24+
or LooseVersion(sys.version) >= LooseVersion('3.8.0')
25+
26+
@pytest.mark.skipif(is_unsupported_version, reason="Asynqp supports >=3.5.3;<3.8.0")
2527
class TestAsynqp(unittest.TestCase):
2628
@asyncio.coroutine
2729
def connect(self):

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818
collect_ignore_glob.append("*test_gevent*")
1919

2020
if LooseVersion(sys.version) < LooseVersion('3.5.3'):
21-
collect_ignore_glob.append("*test_asynqp*")
2221
collect_ignore_glob.append("*test_aiohttp*")
2322
collect_ignore_glob.append("*test_async*")
2423
collect_ignore_glob.append("*test_tornado*")
2524
collect_ignore_glob.append("*test_grpc*")
2625
collect_ignore_glob.append("*test_boto3*")
2726

27+
if LooseVersion(sys.version) < LooseVersion('3.5.3') or LooseVersion(sys.version) >= LooseVersion('3.8.0'):
28+
collect_ignore_glob.append("*test_asynqp*")
29+
2830
if LooseVersion(sys.version) < LooseVersion('3.6.0'):
2931
collect_ignore_glob.append("*test_fastapi*")
3032
collect_ignore_glob.append("*test_starlette*")

tests/requirements-cassandra.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cassandra-driver==3.20.2
2+
mock>=2.0.0
3+
nose>=1.0
4+
pytest>=4.6
5+
urllib3[secure]!=1.25.0,!=1.25.1,<1.26,>=1.21.1

tests/requirements-couchbase.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
couchbase==2.5.9

tests/requirements-gevent.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
flask>=0.12.2
2+
gevent>=1.4.0
3+
mock>=2.0.0
4+
nose>=1.0
5+
pyramid>=1.2
6+
pytest>=4.6
7+
urllib3[secure]!=1.25.0,!=1.25.1,<1.26,>=1.21.1

tests/requirements.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
aiofiles>=0.5.0;python_version>="3.5"
2+
aiohttp>=3.5.4;python_version>="3.5"
3+
asynqp>=0.4;python_version>="3.5"
4+
boto3>=1.10.0
5+
celery>=4.1.1
6+
django>=1.11,<2.2
7+
fastapi>=0.61.1;python_version>="3.6"
8+
flask>=0.12.2
9+
grpcio>=1.18.0
10+
google-cloud-storage>=1.24.0;python_version>="3.5"
11+
lxml>=3.4
12+
mock>=2.0.0
13+
moto>=1.3.16
14+
mysqlclient>=1.3.14;python_version>="3.5"
15+
MySQL-python>=1.2.5;python_version<="2.7"
16+
nose>=1.0
17+
PyMySQL[rsa]>=0.9.1
18+
pyOpenSSL>=16.1.0;python_version<="2.7"
19+
psycopg2>=2.7.1
20+
pymongo>=3.7.0
21+
pyramid>=1.2
22+
pytest>=4.6
23+
pytest-celery
24+
redis>3.0.0
25+
requests>=2.17.1
26+
sqlalchemy>=1.1.15
27+
spyne>=2.9,<=2.12.14
28+
suds-jurko>=0.6
29+
tornado>=4.5.3,<6.0
30+
uvicorn>=0.12.2;python_version>="3.6"
31+
urllib3[secure]!=1.25.0,!=1.25.1,<1.26,>=1.21.1

0 commit comments

Comments
 (0)