Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added detailed inline documentation for custom setuptools build hook#1094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
midhunsai31 wants to merge4 commits intoopencv:4.x
base:4.x
Choose a base branch
Loading
frommidhunsai31:4.x
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions_build_backend/backend.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
# Import the default setuptools PEP 517 build backend under a custom alias
# This allows us to extend or override its functionality where needed
from setuptools import build_meta as _orig

# Re-use the default implementations for standard PEP 517 hook methods
prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel
build_wheel = _orig.build_wheel
build_sdist = _orig.build_sdist
get_requires_for_build_sdist = _orig.get_requires_for_build_sdist

# Override the `get_requires_for_build_wheel` function to add dynamic dependency logic
def get_requires_for_build_wheel(config_settings=None):
from packaging import version
from skbuild.exceptions import SKBuildError
Expand All@@ -13,11 +17,13 @@ def get_requires_for_build_wheel(config_settings=None):
# check if system cmake can be used if present
# if not, append cmake PyPI distribution to required packages
# scikit-build>=0.18 itself requires cmake 3.5+
# Define the minimum required version of CMake (needed by scikit-build>=0.18)
min_version = "3.5"
try:
if version.parse(get_cmake_version().split("-")[0]) < version.parse(min_version):
packages.append(f'cmake>={min_version}')
except SKBuildError:
packages.append(f'cmake>={min_version}')

# Return the final list of required packages for building the wheel
return packages

[8]ページ先頭

©2009-2025 Movatter.jp