zhmcclient / python-zhmcclient

A pure Python client library for the IBM Z HMC Web Services API
Apache License 2.0
39 stars 26 forks source link

stomp.py package name causes issues #1516

Closed andy-maier closed 5 months ago

andy-maier commented 5 months ago

In some circumstances, packages using zhmcclient (e.g. zhmc-log-forwarder) fail to import zhmcclient because zhmcclient references the dependent stomp package using the name "stomp.py" (i.e. with a dot).

The stomp package name on Pypi is "stomp-py". That is also its normalized package name (see https://packaging.python.org/en/latest/specifications/name-normalization/). That article states that package names should be normalized before being used for comparison etc.

It is not clear under which circumstances this issue shows up. I have seen it with the zhmc-log-forwarder and minimum package levels for the very first time: https://github.com/zhmcclient/zhmc-log-forwarder/actions/runs/9498544881/job/26177521997

Tools seem to deal with the normalization differently:

This ticket is to change the package name referenced by zhmcclient to use the normalized package name "stomp-py".

I verified which other package names with dots are referenced by zhmcclient, but they all have that same package name on Pypi:

dev-requirements.txt:backports.statistics>=0.1.0; python_version == '2.7'
minimum-constraints.txt:ruamel.yaml==0.17.21; python_version >= '3.7'
minimum-constraints.txt:backports.functools-lru-cache==1.5; python_version < "3.3"
minimum-constraints.txt:backports.shutil-get-terminal-size==1.0.0
minimum-constraints.txt:backports.ssl-match-hostname==3.5.0.1

Update:

The issue with zhmc-log-forwarder seems to depend on the version of the jsonschema package: With 3.0.1 and 3.0.2, the error happens, and with 3.1.0 and later, the error goes away. It is absolutely not clear why an error complaining about "stomp.py" not found depends on the jsonschema version.

Nevertheless, it is definitely a good idea to make the change in zhmcclient to reference the stomp package by the package name it has on Pypi.