Skip to content

Commit fd82919

Browse files
authored
Merge pull request #44 from reecetech/drop-old-py-versions
Drop support for Python 3.7 and 3.8; Switch to supported `docker compose` for testing
2 parents da6eb20 + 8a8e75a commit fd82919

File tree

5 files changed

+14
-94
lines changed

5 files changed

+14
-94
lines changed

Dockerfile.testing

+1-85
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
# Best to compile and test as non-root
44
ARG nonroot_uid=3973
55

6-
##------------------------------------------------------------------------------
7-
FROM python:3.7 AS py37
8-
9-
RUN echo "${PYTHON_VERSION}" > /tmp/py37-latest
10-
11-
##------------------------------------------------------------------------------
12-
FROM python:3.8 AS py38
13-
14-
RUN echo "${PYTHON_VERSION}" > /tmp/py38-latest
15-
166
##------------------------------------------------------------------------------
177
FROM python:3.9 AS py39
188

@@ -62,72 +52,6 @@ RUN mkdir /usr/local/openssl11 \
6252

6353
RUN mkdir /src
6454

65-
##------------------------------------------------------------------------------
66-
FROM builder-base AS builder-py37
67-
ARG py_ver=37
68-
ARG nonroot_uid
69-
COPY --from=py37 /tmp/py${py_ver}-latest /tmp/
70-
71-
RUN mkdir /opt/py${py_ver} && chown -R ${nonroot_uid} /opt/py${py_ver} /src
72-
USER ${nonroot_uid}
73-
WORKDIR /tmp
74-
75-
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
76-
&& curl --silent --show-error --fail --location \
77-
"https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" \
78-
| tar -xz
79-
80-
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
81-
&& cd "/tmp/Python-${PYTHON_VERSION}" \
82-
&& ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
83-
&& make -j 4 altinstall
84-
85-
USER root
86-
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
87-
RUN pip3 install tox
88-
USER ${nonroot_uid}
89-
90-
ENV HOME=/src
91-
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
92-
WORKDIR /src
93-
94-
ADD django_informixdb/ /src/django_informixdb/
95-
ADD README.rst setup.* tox.ini /src/
96-
RUN tox -e "$(tox --listenvs | grep py${py_ver} | tr '\n' ',')" --notest # prep venvs
97-
98-
##------------------------------------------------------------------------------
99-
FROM builder-base AS builder-py38
100-
ARG py_ver=38
101-
ARG nonroot_uid
102-
COPY --from=py38 /tmp/py${py_ver}-latest /tmp/
103-
104-
RUN mkdir /opt/py${py_ver} && chown -R ${nonroot_uid} /opt/py${py_ver} /src
105-
USER ${nonroot_uid}
106-
WORKDIR /tmp
107-
108-
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
109-
&& curl --silent --show-error --fail --location \
110-
"https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" \
111-
| tar -xz
112-
113-
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
114-
&& cd "/tmp/Python-${PYTHON_VERSION}" \
115-
&& ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
116-
&& make -j 4 altinstall
117-
118-
USER root
119-
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
120-
RUN pip3 install tox
121-
USER ${nonroot_uid}
122-
123-
ENV HOME=/src
124-
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
125-
WORKDIR /src
126-
127-
ADD django_informixdb/ /src/django_informixdb/
128-
ADD README.rst setup.* tox.ini /src/
129-
RUN tox -e "$(tox --listenvs | grep py${py_ver} | tr '\n' ',')" --notest # prep venvs
130-
13155
##------------------------------------------------------------------------------
13256
FROM builder-base AS builder-py39
13357
ARG py_ver=39
@@ -206,14 +130,6 @@ COPY --chown=${nonroot_uid} \
206130
FROM csdk AS multipy
207131
ARG nonroot_uid
208132

209-
COPY --from=builder-py37 /opt/py37/ /opt/py37/
210-
COPY --from=builder-py37 /src/.tox/ /src/.tox/
211-
COPY --from=builder-py37 /src/.cache/ /src/.cache/
212-
213-
COPY --from=builder-py38 /opt/py38/ /opt/py38/
214-
COPY --from=builder-py38 /src/.tox/ /src/.tox/
215-
COPY --from=builder-py38 /src/.cache/ /src/.cache/
216-
217133
COPY --from=builder-py39 /opt/py39/ /opt/py39/
218134
COPY --from=builder-py39 /src/.tox/ /src/.tox/
219135
COPY --from=builder-py39 /src/.cache/ /src/.cache/
@@ -230,7 +146,7 @@ ADD --chown=${nonroot_uid} django_informixdb/ /src/django_informixdb/
230146
ADD --chown=${nonroot_uid} test/ /src/test/
231147
RUN chown ${nonroot_uid} /src
232148

233-
ENV PATH=/opt/py310/bin:/opt/py39/bin:/opt/py38/bin:/opt/py37/bin:"${PATH}"
149+
ENV PATH=/opt/py310/bin:/opt/py39/bin:"${PATH}"
234150
RUN pip3 --no-cache-dir install tox
235151

236152
USER ${nonroot_uid}

README.rst

+6
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@ Requirements: Docker 19.03.2 or newer and Docker Compose 1.24.1 or newer.
307307
Release History
308308
---------------
309309

310+
Version 1.12.1
311+
312+
- End support for Python 3.7
313+
- End support for Python 3.8
314+
- Rework to newer Docker Compose for testing
315+
310316
Version 1.11.4
311317

312318
- Update pyproject.toml / setup.cfg and update docker tests to use Rocky9 instead of Centos7

pyproject.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ classifiers=[
1919
'Topic :: Scientific/Engineering',
2020
'License :: OSI Approved :: Apache Software License',
2121
'Programming Language :: Python :: 3',
22-
'Programming Language :: Python :: 3.7',
23-
'Programming Language :: Python :: 3.8',
2422
'Programming Language :: Python :: 3.9',
2523
'Programming Language :: Python :: 3.10',
2624
]
@@ -53,4 +51,4 @@ version = {attr = "django_informixdb.VERSION"}
5351
readme = {file = "README.rst"}
5452

5553
[tool.distutils.bdist_wheel]
56-
universal = true
54+
universal = true

test-in-docker.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ export uniq_test_id="${uniq_test_id:-djifx}"
88

99
cleanup() {
1010
echo "--- cleaning up: previous code ${?}"
11-
docker-compose -p "${uniq_test_id}" down --volumes --remove-orphans
11+
docker compose -p "${uniq_test_id}" down --volumes --remove-orphans
1212
}
1313
trap cleanup EXIT
1414

1515
echo "--- building docker images"
16-
docker-compose -p "${uniq_test_id}" build
16+
docker compose -p "${uniq_test_id}" build
1717

1818
echo "--- starting dependencies"
19-
docker-compose -p "${uniq_test_id}" up -d db
19+
docker compose -p "${uniq_test_id}" up -d db
2020

2121
echo "--- waiting for dependencies"
22-
docker-compose -p "${uniq_test_id}" run test-runner /usr/local/bin/wait-for-deps.sh
22+
docker compose -p "${uniq_test_id}" run test-runner /usr/local/bin/wait-for-deps.sh
2323

2424
echo "--- running tests"
25-
docker-compose -p "${uniq_test_id}" run test-runner tox
25+
docker compose -p "${uniq_test_id}" run test-runner tox

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37-dj3,py38-dj3,py39-dj3,py310-dj3,py38-dj4,py39-dj4,py310-dj4
2+
envlist = py39-dj3,py310-dj3,py39-dj4,py310-dj4
33

44
[testenv]
55
deps =

0 commit comments

Comments
 (0)