-
Notifications
You must be signed in to change notification settings - Fork 68
Add exclude-exts options #1128
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add exclude-exts options #1128
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,10 @@ def dist_info_contents(self) -> dict[str, bytes]: | |
} | ||
|
||
def build( | ||
self, wheel_dirs: Mapping[str, Path], exclude: Sequence[str] = () | ||
self, | ||
wheel_dirs: Mapping[str, Path], | ||
exclude: Sequence[str] = (), | ||
exclude_exts: Sequence[str] = (), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder why we have defaults for these. But anyway it's an existing pattern. |
||
) -> None: | ||
(targetlib,) = {"platlib", "purelib"} & set(wheel_dirs) | ||
assert { | ||
|
@@ -175,7 +178,7 @@ def build( | |
continue | ||
if any(x.endswith(".dist-info") for x in filename.parts): | ||
continue | ||
if filename.suffix in {".pyc", ".pyo"}: | ||
if filename.suffix in exclude_exts: | ||
continue | ||
relpath = filename.relative_to(path) | ||
if exclude_spec.match_file(relpath): | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -309,6 +309,18 @@ class WheelSettings: | |||||||
may not respect this exclusion. | ||||||||
""" | ||||||||
|
||||||||
exclude_exts: List[str] = dataclasses.field( | ||||||||
default_factory=lambda: [".pyc", ".pyo"], | ||||||||
metadata=SettingsFieldMetadata(display_default="true"), | ||||||||
Comment on lines
+313
to
+314
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
) | ||||||||
""" | ||||||||
A set of file extensions to exclude from the wheel. | ||||||||
|
||||||||
This is additive to the SDist/Wheel exclude patterns. This applies to the final paths | ||||||||
in the wheel, and can exclude files from CMake output as well. Editable installs | ||||||||
may not respect this exclusion. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a |
||||||||
""" | ||||||||
|
||||||||
build_tag: str = "" | ||||||||
""" | ||||||||
The build tag to use for the wheel. If empty, no build tag is used. | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the format looks right here, can you rearrange it? https://scikit-build-core--1128.org.readthedocs.build/en/1128/configuration/index.html#customizing-the-built-wheel
Also, this is new since the introduction of
Config Reference
, but can you use:confval:...
role to reference the new option? There's a nice pop-up of the information about it, so you could de-duplicate some documentation with that.