aqt wheel: fix unintended inclusion of qt/aqt/data (#4180)

The inclusion of files under qt/aqt is handled by qt/pyproject.toml,
not qt/hatch_build.py, which works with the files under out/qt/_aqt.

Excluding qt/aqt/data and all files ending in .ui in qt/pyproject.toml
fixes the issue, since the other unwanted files (**/*.scss, **/*.ts, and
**/tsconfig*) all reside under qt/aqt/data.

Fixes: 04996c77f3
This commit is contained in:
Lucio Sauer 2025-07-07 18:44:08 +02:00 committed by GitHub
parent 8a3b72e6e5
commit 7fe201d6bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View file

@ -67,16 +67,12 @@ class CustomBuildHook(BuildHookInterface):
def _should_exclude(self, path: Path) -> bool:
"""Check if a file should be excluded from the wheel."""
path_str = str(path)
# Exclude __pycache__
if "/__pycache__/" in path_str:
if "/__pycache__/" in str(path):
return True
if path.suffix in [".ui", ".scss", ".map", ".ts"]:
return True
if path.name.startswith("tsconfig"):
return True
if "/aqt/data" in path_str:
return True
return False

View file

@ -77,7 +77,7 @@ ankiw = "aqt:run"
[tool.hatch.build.targets.wheel]
packages = ["aqt"]
exclude = ["**/*.scss", "**/*.ui"]
exclude = ["aqt/data", "**/*.ui"]
[tool.hatch.version]
source = "code"