Skip to content

Commit 3b76768

Browse files
committed
Fix python 3 compatibility.
- Use only f-strings - Fix filename generation for messages with strange characters in the identifier - Upgrade all dependencies - Introduce a development docker image to speed up tool development - Convert all pymqi return data to readable strings - Various smaller output formatting fixes
1 parent cfd9448 commit 3b76768

File tree

8 files changed

+285
-171
lines changed

8 files changed

+285
-171
lines changed

Dockerfile.dev

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM ubuntu:20.04 as build
2+
3+
RUN export DEBIAN_FRONTEND=noninteractive \
4+
&& apt-get update \
5+
&& apt-get install -y --no-install-recommends \
6+
python3-minimal \
7+
python3-pip \
8+
python3-setuptools \
9+
python3-wheel \
10+
python3-dev \
11+
git \
12+
curl \
13+
tar \
14+
build-essential \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
18+
#ENV RDURL="http://192.168.143.1:62489" \
19+
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
20+
VRMF=9.1.4.0
21+
22+
RUN mkdir -p /opt/mqm && cd /opt/mqm \
23+
&& curl -LO "$RDURL/$VRMF-$RDTAR" \
24+
&& tar -zxf ./*.tar.gz \
25+
&& rm -f ./*.tar.gz
26+
27+
RUN mkdir -p /src/punch-q \
28+
&& cd /src/punch-q
29+
ADD . /src/punch-q
30+
31+
WORKDIR /src/punch-q
32+
RUN mkdir wheels \
33+
&& pip3 wheel -w wheels/ -r requirements.txt
34+
35+
# --
36+
FROM ubuntu:20.04
37+
38+
ENV LD_LIBRARY_PATH=/opt/mqm/lib64
39+
40+
COPY --from=build /opt/mqm /opt/mqm
41+
COPY --from=build /src/punch-q /src/punch-q
42+
43+
RUN export DEBIAN_FRONTEND=noninteractive \
44+
&& apt-get update \
45+
&& apt-get install -y --no-install-recommends \
46+
python3 \
47+
python3-pip \
48+
python3-wheel \
49+
python3-setuptools \
50+
&& apt-get clean \
51+
&& rm -rf /var/lib/apt/lists/*
52+
53+
# Cleanup some files we dont need here
54+
RUN rm -Rf /opt/mqm/gskit8 \
55+
&& rm -Rf /opt/mqm/java
56+
57+
RUN pip3 install -r /src/punch-q/requirements.txt -f /src/punch-q/wheels/
58+
59+
RUN mkdir -p /punch-q
60+
VOLUME /punch-q
61+
62+
WORKDIR /punch-q
63+
ADD entrypoint-dev.sh /entrypoint-dev.sh
64+
65+
ENTRYPOINT [ "/entrypoint-dev.sh" ]
66+

entrypoint-dev.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if [ "$1" == "/bin/bash" ]; then
3+
bash
4+
else
5+
pip3 install --editable .
6+
punch-q $@
7+
fi

libpunchq/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '1.2.0'
1+
__version__ = '1.3.0'
22

0 commit comments

Comments
 (0)