[CDRIVER-4759] Fix tasks failing to run calc_release_version.py with Python 3.12 Created: 31/Oct/23  Updated: 01/Nov/23  Resolved: 01/Nov/23

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.25.0

Type: Task Priority: Unknown
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: failing-on-waterfall
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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



 Comments   
Comment by Githook User [ 01/Nov/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4759 Define `Version` in `calc_release_version.py`. (#1460)

  • add simple `Version` class
  • add self test of version sorting
  • revise self-test comment
  • update version in self-test
Generated at Wed Feb 07 21:21:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.