File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ include README.md
44include find_version.py
55include setup.py
66include pyproject.toml
7+ include _build_backend/backend.py
78recursive-include cv2 *
89recursive-include docker *
910recursive-include opencv *
Original file line number Diff line number Diff line change 1+ from setuptools import build_meta as _orig
2+
3+ prepare_metadata_for_build_wheel = _orig .prepare_metadata_for_build_wheel
4+ build_wheel = _orig .build_wheel
5+ build_sdist = _orig .build_sdist
6+ get_requires_for_build_sdist = _orig .get_requires_for_build_sdist
7+
8+ def get_requires_for_build_wheel (config_settings = None ):
9+ from packaging import version
10+ from skbuild .exceptions import SKBuildError
11+ from skbuild .cmaker import get_cmake_version
12+ packages = _orig .get_requires_for_build_wheel (config_settings )
13+ # check if system cmake can be used if present
14+ # if not, append cmake PyPI distribution to required packages
15+ # scikit-build>=0.18 itself requires cmake 3.5+
16+ min_version = "3.5"
17+ try :
18+ if version .parse (get_cmake_version ().split ("-" )[0 ]) < version .parse (min_version ):
19+ packages .append (f'cmake>={ min_version } ' )
20+ except SKBuildError :
21+ packages .append (f'cmake>={ min_version } ' )
22+
23+ return packages
Original file line number Diff line number Diff line change 11[build-system ]
22requires = [
3- " cmake>=3.1" ,
43 " numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ,
54 " numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ,
65 " numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ,
76 " numpy==1.19.3; python_version<'3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'" ,
87 " numpy==1.21.0; python_version<'3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'" ,
98 " numpy>=2.0.0; python_version>='3.9'" ,
9+ " packaging" ,
1010 " pip" ,
1111 " scikit-build>=0.14.0" ,
1212 " setuptools==59.2.0; python_version<'3.12'" ,
1313 " setuptools<70.0.0; python_version>='3.12'" ,
1414]
15+ # use a custom backend to manage CMake check / installation
16+ # see https://scikit-build.readthedocs.io/en/latest/usage.html#adding-cmake-as-building-requirement-only-if-not-installed-or-too-low-a-version
17+ build-backend = " backend"
18+ backend-path = [" _build_backend" ]
You can’t perform that action at this time.
0 commit comments