Skip to content

Commit af162e7

Browse files
jaygel179darinhoward
authored andcommitted
Python 3.8 support (#9)
Changes: - update proper versions for pythons - add support for python 3.8 - add docket tests for different versions
1 parent f2e47ec commit af162e7

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

docker/stackify-python-api-test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARG from_version
2+
3+
FROM python:${from_version}
4+
5+
ARG version
6+
7+
RUN \
8+
apt-get update && \
9+
apt-get install -y flake8 && \
10+
pip install --upgrade pip && \
11+
python --version
12+
13+
RUN mkdir /build
14+
COPY . /build/
15+
16+
RUN cat /build/requirements.txt | xargs -n 1 pip install; exit 0
17+
18+
CMD /bin/bash -c "cd /build && source test-docker-execute.sh"

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,18 @@
3030
long_description=long_description,
3131
long_description_content_type="text/markdown",
3232
keywords=['logging', 'stackify', 'exception'],
33-
classifiers=["Programming Language :: Python"],
33+
classifiers=[
34+
"Programming Language :: Python",
35+
"Programming Language :: Python :: 2.7",
36+
"Programming Language :: Python :: 3.4",
37+
"Programming Language :: Python :: 3.5",
38+
"Programming Language :: Python :: 3.6",
39+
"Programming Language :: Python :: 3.7",
40+
"Programming Language :: Python :: 3.8",
41+
"Programming Language :: Python :: Implementation :: CPython",
42+
"Programming Language :: Python :: Implementation :: PyPy",
43+
"Operating System :: OS Independent",
44+
],
3445
install_requires=[
3546
'protobuf>=3.9.1',
3647
'retrying>=1.2.3',

test-docker-execute.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
function runFlake8() {
6+
echo '<--------------------------------------------->'
7+
# run flake8 and exit on error
8+
# it will check the code base against coding style (PEP8) and programming errors
9+
echo "Running flake8..."
10+
flake8 || { echo 'You have increased the number of flake8 errors'; exit 1; }
11+
}
12+
13+
function runPyTest() {
14+
echo '<--------------------------------------------->'
15+
echo "Python Version $(python --version)"
16+
echo 'Running pytest...'
17+
py.test
18+
}
19+
20+
runFlake8
21+
22+
runPyTest

test-docker.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
VERSIONS=('2.7' '3.4' '3.5' '3.6' '3.7' '3.8')
6+
# VERSIONS=('2.7')
7+
8+
for i in "${VERSIONS[@]}"
9+
do
10+
11+
if [[ "$(docker images -q stackify-python-api-test-${i}:latest 2> /dev/null)" != "" ]]; then
12+
echo "Delete stackify-python-api-test-${i}..."
13+
docker rm stackify-python-api-test-${i} &>/dev/null
14+
docker rmi stackify-python-api-test-${i}:latest &>/dev/null
15+
fi
16+
17+
echo "Building stackify-python-api-test-${i}..."
18+
docker build --no-cache --build-arg from_version=${i} --build-arg version=${i} --file docker/stackify-python-api-test . -t stackify-python-api-test-${i}:latest
19+
20+
echo "Running stackify-python-api-test-${i}..."
21+
docker run --network="host" --name "stackify-python-api-test-${i}" stackify-python-api-test-${i}:latest
22+
23+
echo "Delete stackify-python-api-test-${i}..."
24+
docker rm stackify-python-api-test-${i} &>/dev/null
25+
docker rmi stackify-python-api-test-${i}:latest &>/dev/null
26+
27+
done
28+
29+
echo "Done"

0 commit comments

Comments
 (0)