metricq / metricq-python

🐍 The MetricQ Python interface
https://metricq.github.io/metricq-python/
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

Setup Fails, in protobuf version 27.3 #194

Closed floork closed 1 month ago

floork commented 1 month ago

Issue Summary:

In certain versions of protobuf (tested on 27.3), the installation process for the metricq-python package fails due to the version chosen by the setup.py (protobuf<3.4,>=3.3).

Manually updating the protobuf requirement to protobuf<4.22,>=4.21 resolves the issue and allows the package to be installed correctly.

Steps to Reproduce:

  1. Set up an environment with protobuf version 27.3 installed.
    protoc --version
    libprotoc 27.3
  2. Run the following command:
    pip install -e '.[dev]'
  3. The installation fails when building the protobuf wheel, as shown in the error message.

Observed Error:

The installation process produces the following error:

ImportError: cannot import name 'build_py_2to3' from 'distutils.command.build_py'

This occurs due to the outdated version of protobuf being pulled in (version 3.3.0), which is incompatible with modern build systems.

Workaround:

Update the system so that protobuf 28 is installed:

protoc --version
libprotoc 28.0
floork commented 1 month ago

Up on closer inspection it still uses the wrong version after the update, even doe its building (but stuff like tox do not work with this version and would need a higher major version, so 5)

bmario commented 1 month ago

The usual protobuf stinks.

Seems like 5.26 bumped the major version again, hence a new version tuple is needed here:

https://github.com/metricq/metricq-python/blob/master/setup.py#L118