Skip to content

Commit fc5f2df

Browse files
General maintenance and tidying to ensure tests pass. (#136)
* Add M1 support and update dependencies. * Restrict to pubsub client < 2 because of breaking changes. * Add platform option. * Improve error messages. * Clean up database tests. * Add missing skipif reason. * Various changes to make tests pass. * Fix linting errors. * Fail fast given long test cycle. * Only use pymssql for arm. * Only use azure sql edge image for arm. * Use pymssql instead of pyodbc. * Add ConnectionError to list of transient errors. * Add BrokenPipeError to transient errors. * Mark kafka tests as failing. * Simplify Kafka configuration. * Use pymssql in container. * Resolve dependency conflict with flake8. * Partially revert `kafka` changes. * Fix `rabbitmq` readiness probe. * Add ValueError to transient kafka errors.
1 parent 6641b25 commit fc5f2df

29 files changed

+733
-379
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ jobs:
2525
restore-keys: |
2626
${{ runner.os }}-pip-
2727
${{ runner.os }}-
28-
- name: Install system requirements
29-
run: |
30-
sudo apt-get install -y --no-install-recommends unixodbc-dev # required for pyodbc
31-
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
32-
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
33-
sudo apt-get -qq update
34-
sudo ACCEPT_EULA=Y apt-get -y install msodbcsql17
3528
- name: Install Python dependencies
3629
run: |
3730
python -m pip install --upgrade pip
@@ -51,5 +44,5 @@ jobs:
5144
run: |
5245
flake8
5346
sphinx-build -nW docs docs/_build/html
54-
py.test -sv --cov-config .coveragerc --cov-report html:skip-covered --cov-report term:skip-covered --cov=testcontainers --tb=short tests/
47+
py.test -svx --cov-config .coveragerc --cov-report html:skip-covered --cov-report term:skip-covered --cov=testcontainers --tb=short tests/
5548
codecov

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
ARG version=3.8
22
FROM python:${version}
33

4+
WORKDIR /workspace
5+
RUN pip install --upgrade pip \
6+
&& apt-get update \
7+
&& apt-get install -y \
8+
freetds-dev \
9+
&& rm -rf /var/lib/apt/lists/*
410
WORKDIR /workspace
511
ARG version=3.8
612
COPY requirements/${version}.txt requirements.txt

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
PYTHON_VERSIONS = 3.6 3.7 3.8
1+
PYTHON_VERSIONS = 3.6 3.7 3.8 3.9
22
REQUIREMENTS = $(addprefix requirements/,${PYTHON_VERSIONS:=.txt})
33
TESTS = $(addprefix tests/,${PYTHON_VERSIONS})
44
IMAGES = $(addprefix image/,${PYTHON_VERSIONS})
55
RUN = docker run --rm -it
6+
67
.PHONY : docs
78

89
# Default target
@@ -17,7 +18,7 @@ requirements : ${REQUIREMENTS}
1718
${REQUIREMENTS} : requirements/%.txt : requirements.in setup.py
1819
mkdir -p $(dir $@)
1920
${RUN} -w /workspace -v `pwd`:/workspace python:$* bash -c \
20-
"pip install pip-tools && pip-compile -v -o $@ $<"
21+
"pip install pip-tools && pip-compile -v --upgrade -o $@ $<"
2122

2223

2324
# Targets to build docker images
@@ -33,8 +34,8 @@ ${IMAGES} : image/% : requirements/%.txt
3334
tests : ${TESTS}
3435

3536
${TESTS} : tests/% : image/%
36-
${RUN} -v /var/run/docker.sock:/var/run/docker.sock testcontainers-python:$* bash -c \
37-
"flake8 && pytest -v ${ARGS}"
37+
${RUN} -v /var/run/docker.sock:/var/run/docker.sock testcontainers-python:$* \
38+
bash -c "flake8 && pytest -v ${ARGS}"
3839

3940
# Target to build the documentation
4041

requirements.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
-e file:.[docker-compose,mysql,oracle,postgresql,selenium,google-cloud-pubsub,mongo,redis,mssqlserver,neo4j,kafka,rabbitmq]
22
codecov>=2.1.0
3-
flake8
3+
flake8<3.8.0 # 3.8.0 adds a dependency on importlib-metadata which conflicts with other packages.
44
pytest
55
pytest-cov
66
sphinx
7-
docker<4.3.0

requirements/3.6.txt

Lines changed: 93 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -8,221 +8,235 @@
88
# via -r requirements.in
99
alabaster==0.7.12
1010
# via sphinx
11-
attrs==19.3.0
11+
async-timeout==4.0.2
12+
# via redis
13+
attrs==21.4.0
1214
# via
1315
# jsonschema
1416
# pytest
15-
babel==2.8.0
17+
babel==2.9.1
1618
# via sphinx
1719
bcrypt==3.2.0
1820
# via paramiko
19-
cached-property==1.5.1
21+
cached-property==1.5.2
2022
# via docker-compose
21-
cachetools==4.1.1
23+
cachetools==4.2.4
2224
# via google-auth
23-
certifi==2020.6.20
25+
certifi==2021.10.8
2426
# via requests
25-
cffi==1.14.2
27+
cffi==1.15.0
2628
# via
2729
# bcrypt
2830
# cryptography
2931
# pynacl
30-
chardet==3.0.4
32+
charset-normalizer==2.0.12
3133
# via requests
32-
codecov==2.1.8
34+
codecov==2.1.12
3335
# via -r requirements.in
34-
coverage==5.2.1
36+
coverage[toml]==6.2
3537
# via
3638
# codecov
3739
# pytest-cov
38-
cryptography==3.0
40+
cryptography==36.0.2
3941
# via paramiko
40-
cx-oracle==8.0.0
42+
cx-oracle==8.3.0
4143
# via testcontainers
44+
deprecated==1.2.13
45+
# via redis
4246
deprecation==2.1.0
4347
# via testcontainers
44-
distro==1.5.0
48+
distro==1.7.0
4549
# via docker-compose
46-
docker[ssh]==4.2.2
50+
docker[ssh]==5.0.3
4751
# via
48-
# -r requirements.in
4952
# docker-compose
5053
# testcontainers
51-
docker-compose==1.26.2
54+
docker-compose==1.29.2
5255
# via testcontainers
5356
dockerpty==0.4.1
5457
# via docker-compose
5558
docopt==0.6.2
5659
# via docker-compose
57-
docutils==0.16
60+
docutils==0.17.1
5861
# via sphinx
59-
flake8==3.8.3
62+
entrypoints==0.3
63+
# via flake8
64+
flake8==3.7.9
6065
# via -r requirements.in
61-
google-api-core[grpc]==1.22.1
66+
google-api-core[grpc]==2.7.1
6267
# via google-cloud-pubsub
63-
google-auth==1.20.1
68+
google-auth==2.6.2
6469
# via google-api-core
6570
google-cloud-pubsub==1.7.0
6671
# via testcontainers
67-
googleapis-common-protos[grpc]==1.52.0
72+
googleapis-common-protos[grpc]==1.56.0
6873
# via
6974
# google-api-core
7075
# grpc-google-iam-v1
76+
# grpcio-status
77+
greenlet==1.1.2
78+
# via sqlalchemy
7179
grpc-google-iam-v1==0.12.3
7280
# via google-cloud-pubsub
73-
grpcio==1.31.0
81+
grpcio==1.45.0
7482
# via
7583
# google-api-core
7684
# googleapis-common-protos
7785
# grpc-google-iam-v1
78-
idna==2.10
86+
# grpcio-status
87+
grpcio-status==1.45.0
88+
# via google-api-core
89+
idna==3.3
7990
# via requests
80-
imagesize==1.2.0
91+
imagesize==1.3.0
8192
# via sphinx
82-
importlib-metadata==1.7.0
93+
importlib-metadata==4.8.3
8394
# via
84-
# flake8
8595
# jsonschema
8696
# pluggy
8797
# pytest
88-
iniconfig==1.0.1
98+
# redis
99+
# sphinx
100+
# sqlalchemy
101+
iniconfig==1.1.1
89102
# via pytest
90-
jinja2==2.11.2
103+
jinja2==3.0.3
91104
# via sphinx
92105
jsonschema==3.2.0
93106
# via docker-compose
94107
kafka-python==2.0.2
95108
# via testcontainers
96-
markupsafe==1.1.1
109+
markupsafe==2.0.1
97110
# via jinja2
98111
mccabe==0.6.1
99112
# via flake8
100-
more-itertools==8.4.0
101-
# via pytest
102-
neo4j==4.1.0
113+
neo4j==4.4.2
103114
# via testcontainers
104-
packaging==20.4
115+
packaging==21.3
105116
# via
106117
# deprecation
107118
# pytest
119+
# redis
108120
# sphinx
109-
paramiko==2.7.1
121+
paramiko==2.10.3
110122
# via docker
111123
pika==1.2.0
112124
# via testcontainers
113-
pluggy==0.13.1
125+
pluggy==1.0.0
114126
# via pytest
115-
protobuf==3.13.0
127+
protobuf==3.19.4
116128
# via
117129
# google-api-core
118130
# googleapis-common-protos
119-
psycopg2-binary==2.8.5
131+
# grpcio-status
132+
psycopg2-binary==2.9.3
120133
# via testcontainers
121-
py==1.9.0
134+
py==1.11.0
122135
# via pytest
123136
pyasn1==0.4.8
124137
# via
125138
# pyasn1-modules
126139
# rsa
127140
pyasn1-modules==0.2.8
128141
# via google-auth
129-
pycodestyle==2.6.0
142+
pycodestyle==2.5.0
130143
# via flake8
131-
pycparser==2.20
144+
pycparser==2.21
132145
# via cffi
133-
pyflakes==2.2.0
146+
pyflakes==2.1.1
134147
# via flake8
135-
pygments==2.6.1
148+
pygments==2.11.2
136149
# via sphinx
137-
pymongo==3.11.0
150+
pymongo==4.0.2
138151
# via testcontainers
139-
pymysql==0.10.0
152+
pymssql==2.2.4
140153
# via testcontainers
141-
pynacl==1.4.0
142-
# via paramiko
143-
pyodbc==4.0.30
154+
pymysql==1.0.2
144155
# via testcontainers
145-
pyparsing==2.4.7
156+
pynacl==1.5.0
157+
# via paramiko
158+
pyparsing==3.0.7
146159
# via packaging
147-
pyrsistent==0.16.0
160+
pyrsistent==0.18.0
148161
# via jsonschema
149-
pytest==6.0.1
162+
pytest==7.0.1
150163
# via
151164
# -r requirements.in
152165
# pytest-cov
153-
pytest-cov==2.10.1
166+
pytest-cov==3.0.0
154167
# via -r requirements.in
155-
python-dotenv==0.14.0
168+
python-dotenv==0.20.0
156169
# via docker-compose
157-
pytz==2020.1
170+
pytz==2022.1
158171
# via
159172
# babel
160-
# google-api-core
161173
# neo4j
162-
pyyaml==5.3.1
174+
pyyaml==5.4.1
163175
# via docker-compose
164-
redis==3.5.3
176+
redis==4.2.0
165177
# via testcontainers
166-
requests==2.24.0
178+
requests==2.27.1
167179
# via
168180
# codecov
169181
# docker
170182
# docker-compose
171183
# google-api-core
172184
# sphinx
173-
rsa==4.6
185+
rsa==4.8
174186
# via google-auth
175187
selenium==3.141.0
176188
# via testcontainers
177-
six==1.15.0
189+
six==1.16.0
178190
# via
179191
# bcrypt
180-
# cryptography
181-
# docker
182-
# docker-compose
183192
# dockerpty
184-
# google-api-core
185193
# google-auth
186194
# grpcio
187195
# jsonschema
188-
# packaging
189-
# protobuf
190-
# pynacl
191-
# pyrsistent
196+
# paramiko
192197
# websocket-client
193-
snowballstemmer==2.0.0
198+
snowballstemmer==2.2.0
194199
# via sphinx
195-
sphinx==3.2.1
200+
sphinx==4.4.0
196201
# via -r requirements.in
197202
sphinxcontrib-applehelp==1.0.2
198203
# via sphinx
199204
sphinxcontrib-devhelp==1.0.2
200205
# via sphinx
201-
sphinxcontrib-htmlhelp==1.0.3
206+
sphinxcontrib-htmlhelp==2.0.0
202207
# via sphinx
203208
sphinxcontrib-jsmath==1.0.1
204209
# via sphinx
205210
sphinxcontrib-qthelp==1.0.3
206211
# via sphinx
207-
sphinxcontrib-serializinghtml==1.1.4
212+
sphinxcontrib-serializinghtml==1.1.5
208213
# via sphinx
209-
sqlalchemy==1.3.18
214+
sqlalchemy==1.4.32
210215
# via testcontainers
211-
texttable==1.6.2
216+
texttable==1.6.4
212217
# via docker-compose
213-
toml==0.10.1
214-
# via pytest
215-
urllib3==1.25.10
218+
tomli==1.2.3
219+
# via
220+
# coverage
221+
# pytest
222+
typing-extensions==4.1.1
223+
# via
224+
# async-timeout
225+
# importlib-metadata
226+
# redis
227+
urllib3==1.26.9
216228
# via
217229
# requests
218230
# selenium
219-
websocket-client==0.57.0
231+
websocket-client==0.59.0
220232
# via
221233
# docker
222234
# docker-compose
223-
wrapt==1.12.1
224-
# via testcontainers
225-
zipp==3.1.0
235+
wrapt==1.14.0
236+
# via
237+
# deprecated
238+
# testcontainers
239+
zipp==3.6.0
226240
# via importlib-metadata
227241

228242
# The following packages are considered to be unsafe in a requirements file:

0 commit comments

Comments
 (0)