Skip to content

Commit 1400b28

Browse files
committed
Doc updates for 2nd beta
1 parent 6b64339 commit 1400b28

File tree

6 files changed

+66
-14
lines changed

6 files changed

+66
-14
lines changed

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
# Changelog
33
Newest updates are at the top of this file.
44

5-
## 2025 Sep 10 - V2
6-
Initial release of the reworked PyMQI library for IBM MQ as `ibmmq`.
5+
## 2025 Sep 30 - V2.0.0b2
6+
* Further reduction in pylint/flake8 warnings
7+
* C extension now conforms to the "Limited" API (Python 3.9) for better forwards-compatibility of the binary library
8+
* Updates to various documentation files
9+
* Better diagnostics if apps incorrectly set structure fields to `None`
10+
* Release process checks the C code builds against MQ 9.1 (#1)
11+
12+
## 2025 Sep 10 - V2.0.0b1
13+
Initial beta release of the reworked PyMQI library for IBM MQ as `ibmmq`.
714

815
Apart from the change in package name, the main changes from the PyMQI V1 library implemented in this V2 release
916
include:
@@ -97,6 +104,5 @@ the oldest levels designed for.
97104
* Added MQObject as superclass of queues, topics etc for potential future simplifications
98105
* The C module is considered an internal interface and has changed to match new requirements from the Python layer above
99106
it.
100-
* The C extension is now built using the "Limited" API to help with forwards-compatibility of the binary library
101107
* Text strings from error classes (MQMIError, PYIFError) slightly modified
102108
* Non-public elements of structures (eg `StrucId` or `Reserved`) given `_` prefix

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ enhancements and removed features, see the [CHANGELOG](CHANGELOG.md) file.
2828
## Installation
2929
The package is available from PyPI for easy installation.
3030

31+
See the section on "Distributions and wheels" in the [DesignNotes](docs/DesignNotes.md) file for some other ways you
32+
might like to build and locally deploy this package with your applications.
33+
3134
### Prerequisites
3235

3336
* You first need to install an IBM MQ C client including the SDK component on the system where this package is about to
@@ -80,11 +83,15 @@ handling were added. New classes implement missing structures such as MQCNO and
8083
[CHANGELOG](CHANGELOG.md).
8184

8285
### Not implemented
83-
There are some features of the C MQI that are rarely, if-ever, used by applications and which have not been implemented:
86+
There are some features of the C MQI that are rarely, if-ever, used by applications. These have not been implemented
87+
and are not likely to ever be:
8488
* Distribution Lists (MQDH). Use publish/subscribe instead.
8589
* Reference Messages (MQRMH)
8690
* Authinfo strucures for client CRL checking (MQAIR). Using a CCDT can be an alternative.
8791

92+
More likely to be implemented if someone really needed it:
93+
* MQOPEN for Process or Namelist objects and hence to MQINQ their properties
94+
8895
Anything to do with exits, including data conversion exits, is also excluded. These need to be written in C.
8996

9097
## Demonstration code
@@ -133,8 +140,8 @@ There are many example programs in the `code/examples` directory. These show use
133140
the [README](code/examples/README.md) file for a fuller list.
134141

135142
And unittest components are in the `code/tests` directory. With a `runAllTests.sh` script to exercise them. That script
136-
is very likely to need changing for your environment (including how it starts a queue manager) but they may still
137-
be helpful to see use of the functions.
143+
is very likely to need changing for your environment (including how it starts a queue manager) but they may still be
144+
helpful to see use of the functions.
138145

139146
## Contributions and Pull requests
140147

@@ -164,8 +171,8 @@ original repository were not available to be migrated across to the new location
164171

165172
## Acknowledgments
166173
This package builds on the work done in PyMQI V1. Contributors to that include:
167-
* Dariusz Suchojad (primary contributor/maintainer)
174+
* Dariusz Suchojad (primary contributor/maintainer)
168175
* Vyacheslav Savchenko
169-
* L. Smithson
176+
* L. Smithson
170177
* hjoukl
171178

code/examples/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ARG BASE_IMAGE=registry.access.redhat.com/ubi8/python-312
1111
FROM $BASE_IMAGE
1212

13-
ENV VRMF=9.4.4.0 \
13+
ENV VRMF=9.4.3.0 \
1414
genmqpkg_incnls=1 \
1515
genmqpkg_incsdk=1 \
1616
genmqpkg_inctls=1
@@ -108,8 +108,8 @@ ENV LD_LIBRARY_PATH=/opt/mqm/lib64
108108
USER 1001
109109

110110
# Install the MQ Python library. This will build against the installed SDK
111-
# RUN pip install --verbose --config-settings=--build-option=server ibmmq
112-
RUN pip install ibmmq
111+
RUN pip install --verbose ibmmq
112+
# RUN pip install ibmmq
113113

114114
# Copy a sample program into the container
115115
COPY connect_simple.py .

code/examples/async_consume.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ class Status:
1414
ok = True
1515
connBroken = False
1616

17+
1718
def cb_func(**kwargs):
1819
"""
1920
The callback function is called with parameters:
2021
queue_manager, queue, md, gmo, msg, cbc
2122
The CallbackContext (cbd) structure holds the reasons for invocation, along with
2223
object and connection-related correlation buffers. Which we print out here
24+
25+
The function can be defined as a method within a class by adding a "self" parameter.
2326
"""
2427
msg = kwargs['msg']
2528
cbc = kwargs['cbc']

docs/DesignNotes.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ but it is necessary while the C function is executed as it's on a thread that th
170170
know about otherwise. As some of the requirements for the GIL are relaxed going forward, there might be changes
171171
needed here - initial reading suggests everything will continue to work unchanged but we can't be certain.
172172

173+
The application callback function can be defined as a class method. In that case, the function signature changes
174+
from `cbfn(**kwargs)` to `cbfn(self,**kwargs)`.
175+
173176
## Python/C split
174177
In general, logic goes into the Python layer rather than C. For example, setting MQCNO_HANDLE_SHARE flags could be done
175178
in the _connect()_ method or the MQCONNX C wrapper. I've chosen to do it in Python, to keep the C code as
@@ -187,3 +190,21 @@ The split had to be sensitive to import ordering; otherwise you can get errors a
187190
probably a more elegant split of code across the multiple files, perhaps moving some of the common code to different
188191
places (maybe into the new `MQObject` class), but this arrangement works for now. The split was important for
189192
maintainability, being able to more easily find what was where.
193+
194+
## Distributions, binary files, wheels and PyPI
195+
Only the source distribution gets uploaded to PyPI. That is because of restrictions on platforms and versions: I only
196+
have access to a few platforms at random versions, and Python wheels are tightly linked to the local versions of the OS
197+
and Python itself. I do not want to have to create multiple wheels. Even doing a Python-version-specific wheel for Linux
198+
is non-trivial, needing to be built in a special "multilinux" environment. Perhaps one day, I could automate the process
199+
of building and uploading with GitHub actions for some architectures. But not at the moment.
200+
201+
I **have** however been able to make the C extension module more agnostic as to the version of Python it's running with.
202+
It now conforms to the [Limited API](https://docs.python.org/3/c-api/stable.html#limited-c-api) at the Python 3.9 level.
203+
This ought to make it easier to redistribute applications within your own environment, compiling only once and copying
204+
the `.so` file to other environments with Python 3.9 or newer levels.
205+
206+
The `tools` subdirectory also includes scripts to let you run your own PyPI-equivalent local server, and to upload
207+
binary wheels to that location. See the `testInstServer.sh` and `testInstClient.sh` scripts. They will almost certainly
208+
require modifications for your own systems, but the basic framework is there. This local PyPI server does not have all
209+
the same constraints that the real PyPI has. For example, it doesn't stop you uploading a Linux wheel that has been
210+
built outside the "multilinux" framework. Again, that may help with internal distribution of your applications.

tools/pyRelease.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ defaultRepository=$testRepository
5454
repositoryFlag="--repository"
5555

5656
useTestServer=true
57+
useLocalServer=false
5758
verbose=false
5859

5960
keyFileProd="$HOME/.creds/pythonPyPi"
@@ -83,6 +84,7 @@ do
8384
# Use "testInstServer.sh" to setup a local PyPI server
8485
repository=$localRepository
8586
repositoryFlag="--repository-url"
87+
useLocalServer=true
8688
# Option to delete any packages on the server so we can reuse
8789
# the version number
8890
case $OPTARG in
@@ -202,7 +204,7 @@ echo "----------------------------"
202204
cat *tar* | tar -tvzf -
203205
echo
204206

205-
# Don't care about the wheel as it's not uploaded
207+
# Don't care about the wheel's contents as it's not normally uploaded
206208
# unzip -l *whl
207209
fi
208210

@@ -232,13 +234,26 @@ export TWINE_PASSWORD="$tok"
232234
# And using the "manylinux" prebuilder environments is getting way too complicated.
233235

234236
# verboseUpload="--verbose"
235-
# If using the local repository, then make sure the pypi-server is running
237+
238+
# If using the local repository, then first make sure the pypi-server is running
239+
# And uncomment the upload line if you want to try uploading binary wheels to the local server.
240+
if $useLocalServer
241+
then
242+
echo
243+
# python -m twine upload $repositoryFlag $repository $verboseUpload dist/$pkg*whl*
244+
if [ $? -ne 0 ]
245+
then
246+
echo "ERROR: Upload of binary wheel failed"
247+
exit 1
248+
fi
249+
fi
250+
236251
python -m twine upload $repositoryFlag $repository $verboseUpload dist/$pkg*.tar.gz
237252
if [ $? -ne 0 ]
238253
then
239254
echo "ERROR: Upload failed"
240255
exit 1
241256
fi
242257

243-
echo "Upload to repository was successful"
258+
echo "Upload to repository $repository was successful"
244259
exit 0

0 commit comments

Comments
 (0)