Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4759

Fix tasks failing to run calc_release_version.py with Python 3.12

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.25.0
    • Affects Version/s: None
    • Component/s: None

      Some tasks have recently started failing to run calc_release_version.py. Example:

      Traceback (most recent call last):
        File "/System/Volumes/Data/data/mci/1caa136a8a866fee5ec81f49bed8c650/mongoc/build/cmake/../calc_release_version.py", line 52, in <module>
          from packaging.version import Version as Version
      ModuleNotFoundError: No module named 'packaging'
      During handling of the above exception, another exception occurred:
      Traceback (most recent call last):
        File "/System/Volumes/Data/data/mci/1caa136a8a866fee5ec81f49bed8c650/mongoc/build/cmake/../calc_release_version.py", line 57, in <module>
          from pkg_resources.extern.packaging.version import Version  # type: ignore
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ModuleNotFoundError: No module named 'pkg_resources'
      During handling of the above exception, another exception occurred:
      Traceback (most recent call last):
        File "/System/Volumes/Data/data/mci/1caa136a8a866fee5ec81f49bed8c650/mongoc/build/cmake/../calc_release_version.py", line 61, in <module>
          from distutils.version import LooseVersion as Version
      ModuleNotFoundError: No module named 'distutils'
      CMake Error at build/cmake/BuildVersion.cmake:43 (message):
        Computing the build version failed! [1]:
      Call Stack (most recent call first):
        build/cmake/BuildVersion.cmake:50 (compute_build_version)
        CMakeLists.txt:5 (include)
      

      This is assumed to be caused by a change in Python 3.12.0. Python 3.12.0 release notes include:

      This means that `distutils`, `setuptools`, `pkg_resources`, and `easy_install` will no longer available by default

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: