File tree 3 files changed +29
-1
lines changed
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ include README.md
4
4
include find_version.py
5
5
include setup.py
6
6
include pyproject.toml
7
+ include _build_backend/backend.py
7
8
recursive-include cv2 *
8
9
recursive-include docker *
9
10
recursive-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 1
1
[build-system ]
2
2
requires = [
3
- " cmake>=3.1" ,
4
3
" numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ,
5
4
" numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ,
6
5
" numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ,
7
6
" numpy==1.19.3; python_version<'3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'" ,
8
7
" numpy==1.21.0; python_version<'3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'" ,
9
8
" numpy>=2.0.0; python_version>='3.9'" ,
9
+ " packaging" ,
10
10
" pip" ,
11
11
" scikit-build>=0.14.0" ,
12
12
" setuptools==59.2.0; python_version<'3.12'" ,
13
13
" setuptools<70.0.0; python_version>='3.12'" ,
14
14
]
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