Skip to content

Commit

Permalink
Python 3.12 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
etang-cw committed Nov 6, 2023
1 parent 439690c commit f9b4946
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
run: .github/workflows/scripts/build-dependencies-macos.sh
- name: Run build script
run: |
pip3 install packaging
python3 scripts/build.py --skip-check-code-style --skip-tests --config ${{ matrix.config.type }} --parallel --cmake-extra "CMAKE_PREFIX_PATH=$HOME/deps" --cmake-extra CMAKE_OSX_DEPLOYMENT_TARGET=10.13
- name: Prepare artifacts
run: |
Expand Down
8 changes: 4 additions & 4 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'''

import argparse
import distutils.version
import packaging.version
import os
import platform
import re
Expand Down Expand Up @@ -53,10 +53,10 @@ def is_mac():
BUILD_ROOT = os.path.abspath(
os.path.join(os.path.split(os.path.abspath(__file__))[0], '..'))
BUILD_CONFIGS = {'debug': 'dbuild', 'release': 'build'}
CMAKE_VERSION_3_13 = distutils.version.StrictVersion('3.13.0')
CMAKE_VERSION_3_13 = packaging.version.Version('3.13.0')
CONFIGURATIONS = ['release', 'debug']
DEFAULT_CONFIGURATION = CONFIGURATIONS[0]
VERSION = distutils.version.StrictVersion('0.0.0')
VERSION = packaging.version.Version('0.0.0')


class BuildError(Exception):
Expand Down Expand Up @@ -194,7 +194,7 @@ def cmake_version():
r'cmake version (?P<version>[\d\.]+)', cmake_version_output)
if match is None:
raise BuildError('failed to get CMake version')
cmake_version = distutils.version.StrictVersion(match.group('version'))
cmake_version = packaging.version.Version(match.group('version'))
return cmake_version


Expand Down

0 comments on commit f9b4946

Please sign in to comment.