From 426143099af5d58ae945ddb35be4783f660bd05e Mon Sep 17 00:00:00 2001 From: SkyLi Date: Sat, 28 Mar 2026 19:50:19 +0800 Subject: [PATCH] fix: restructure src layout to proper package directory Move src/__init__.py, detect.py, diagnose.py, extract_temp.py, utils/ into src/infrared_data/ to fix wheel package structure. Previously the whl placed files at root instead of infrared_data/ directory, causing ModuleNotFoundError on install. Also update pyproject.toml packages.find config to use standard src-layout discovery. --- .gitignore | 1 + pyproject.toml | 4 ++++ src/{ => infrared_data}/__init__.py | 0 src/{ => infrared_data}/detect.py | 0 src/{ => infrared_data}/diagnose.py | 0 src/{ => infrared_data}/extract_temp.py | 0 src/{ => infrared_data}/utils/__init__.py | 0 src/{ => infrared_data}/utils/temp_utils.py | 0 8 files changed, 5 insertions(+) rename src/{ => infrared_data}/__init__.py (100%) rename src/{ => infrared_data}/detect.py (100%) rename src/{ => infrared_data}/diagnose.py (100%) rename src/{ => infrared_data}/extract_temp.py (100%) rename src/{ => infrared_data}/utils/__init__.py (100%) rename src/{ => infrared_data}/utils/temp_utils.py (100%) diff --git a/.gitignore b/.gitignore index c3e07a9..82b0153 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ dist/ build/ *.egg +*.whl # PyTorch *.pth diff --git a/pyproject.toml b/pyproject.toml index 3dd3bfc..f122459 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,10 @@ dependencies = [ ] # PyTorch CUDA版本配置 + +[tool.setuptools.packages] +find = {where = ["src"]} + [tool.uv] # 指定PyTorch使用CUDA索引 [[tool.uv.index]] diff --git a/src/__init__.py b/src/infrared_data/__init__.py similarity index 100% rename from src/__init__.py rename to src/infrared_data/__init__.py diff --git a/src/detect.py b/src/infrared_data/detect.py similarity index 100% rename from src/detect.py rename to src/infrared_data/detect.py diff --git a/src/diagnose.py b/src/infrared_data/diagnose.py similarity index 100% rename from src/diagnose.py rename to src/infrared_data/diagnose.py diff --git a/src/extract_temp.py b/src/infrared_data/extract_temp.py similarity index 100% rename from src/extract_temp.py rename to src/infrared_data/extract_temp.py diff --git a/src/utils/__init__.py b/src/infrared_data/utils/__init__.py similarity index 100% rename from src/utils/__init__.py rename to src/infrared_data/utils/__init__.py diff --git a/src/utils/temp_utils.py b/src/infrared_data/utils/temp_utils.py similarity index 100% rename from src/utils/temp_utils.py rename to src/infrared_data/utils/temp_utils.py