Skip to content

Add Python 3.13 support and loosen protobuf version constraint #2075

@bkeryan

Description

@bkeryan

Description of issue

The current stable release of Python is version 3.13, which was released on 10-7-2024.

There are versioning conflicts between nimi-python's grpc extra and Python 3.13:

  • nimi-python's grpc extra requires protobuf>=4.21.6,<5.0.
  • The first version of grpcio and grpcio-tools with binary wheels for Python 3.13 is version 1.67.0
  • grpcio-tools version 1.67.0 requires protobuf version <6.0dev,>=5.26.1.

This causes issues when upgrading ni-measurement-plugin-sdk-service's dev/test dependencies, since it depends on grpcio-tools for gRPC codegen and several nimi-python packages for testing.

PS C:\dev\measurement-plugin-python\packages\service> poetry lock --no-update
Resolving dependencies... (4.9s)

Because no versions of niswitch match >1.4.4,<1.4.5 || >1.4.5,<1.4.6 || >1.4.6,<1.4.7 || >1.4.7,<1.4.8 || >1.4.8
 and niswitch[grpc] (1.4.4) depends on protobuf (>=4.21,<5.0), niswitch[grpc] (>=1.4.4,<1.4.5 || >1.4.5,<1.4.6 || >1.4.6,<1.4.7 || >1.4.7,<1.4.8 || >1.4.8) requires protobuf (>=4.21,<5.0).
And because niswitch[grpc] (1.4.5) depends on protobuf (>=4.21,<5.0), niswitch[grpc] (>=1.4.4,<1.4.6 || >1.4.6,<1.4.7 || >1.4.7,<1.4.8 || >1.4.8) requires protobuf (>=4.21,<5.0).
And because niswitch[grpc] (1.4.6) depends on protobuf (>=4.21,<5.0)
 and niswitch[grpc] (1.4.7) depends on protobuf (>=4.21,<5.0), niswitch[grpc] (>=1.4.4,<1.4.8 || >1.4.8) requires protobuf (>=4.21,<5.0).
And because niswitch[grpc] (1.4.8) depends on protobuf (>=4.21.6,<5.0)
 and grpcio-tools (1.67.0) depends on protobuf (>=5.26.1,<6.0dev), niswitch[grpc] (>=1.4.4) is incompatible with grpcio-tools (1.67.0).
So, because ni-measurement-plugin-sdk-service depends on both niswitch[grpc] (>=1.4.4) and grpcio-tools (1.67.0), version solving failed.

The protobuf package follows semantic versioning, so I think it was reasonable to use >=4.21,<5.0 based on what we knew about it, but based on what I've seen with nidaqmx-python, it appears that output from grpcio-tools 1.49.1 works with both protobuf v4 and v5. I was able to change nidaqmx-python's protobuf version constraint from ^4.21 (aka >=4.21,<5.0) to >=4.21: ni/nidaqmx-python#645

System report

python -c "import niscope; niscope.print_diagnostic_information()" output (replace niscope with appropriate package name)

N/A, can't install

Steps to reproduce issue

  1. Download https://github.com/ni/measurement-plugin-python/tree/users/bkeryan/python-3.13
  2. cd to packages/service
  3. poetry lock --no-update

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions