diff --git a/.gitignore b/.gitignore index 38fdd9a..abfb09f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ __pycache__/ /dist /build/ /usb_util.egg-info + +# === local dev artifacts === +.vscode/ +pip.conf diff --git a/README.md b/README.md index 5d273d4..596c44c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@
-[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/) +[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT) **AiLab Project Documentation** @@ -30,7 +30,7 @@ USB-utilは、接続済みのUSBデバイス/BLEデバイスをスキャンし ## 技術仕様・動作環境 -- Python: 3.9以降 +- Python: 3.10以降(推奨 3.10.18) - macOS/Linux: libusb 1.0(PyUSBバックエンド) - Windows: WMIサービス有効な環境(WinUSB/Zadig等不要) - ネイティブライブラリのビルド/読み込みに必要な環境 @@ -302,3 +302,24 @@ MIT License ## 作者 - TITManagement 2025 + + +## 対象者 +- 運用担当者: 日常運用・手順実行を行う担当者 +- 開発者: 機能追加・保守を行う担当者 +- 検証担当者: 実機/テスト環境で動作確認を行う担当者 + +## 依存関係 +- Python: `pyproject.toml` の `requires-python` に従う +- 主要ライブラリ: `pyproject.toml` の `dependencies` を参照 +- pip index設定: `$AILAB_ROOT/lab_automation_module/config/pip/pip.conf.local` を正本とする + +## 最短セットアップ +`bash` / `zsh` で以下を実行。 +```bash +export AILAB_ROOT=/path/to/AiLab +export PIP_CONFIG_FILE="$AILAB_ROOT/lab_automation_module/config/pip/pip.conf.local" +python -m venv .venv +source .venv/bin/activate +python -m pip install -e . +``` diff --git a/core/scanners.py b/core/scanners.py index e184511..43c3623 100644 --- a/core/scanners.py +++ b/core/scanners.py @@ -13,7 +13,15 @@ from .device_models import UsbDeviceSnapshot AK_COMM_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), "..", "..", "..", "lab_automation_api", "libs", "ak_communication") + os.path.join( + os.path.dirname(__file__), + "..", + "..", + "..", + "lab_automation_libs", + "device_drivers", + "ak-communication", + ) ) if AK_COMM_ROOT not in sys.path and os.path.isdir(AK_COMM_ROOT): sys.path.insert(0, AK_COMM_ROOT) diff --git a/pyproject.toml b/pyproject.toml index 148afd0..f984eb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,11 +7,14 @@ build-backend = "setuptools.build_meta" [project] +authors = [{ name = "Takaya Inoue" }] +maintainers = [{ name = "AUTO Kobo headquarters" }] +readme = "README.md" name = "usb-util" version = "0.1.1" license = { text = "MIT" } description = "USB utility helpers" -requires-python = ">=3.8" +requires-python = ">=3.10" dependencies = [ "customtkinter>=5.2.0", "Pillow>=10.0.0", diff --git a/usb_util_gui.py b/usb_util_gui.py index 93b163d..453a7b9 100644 --- a/usb_util_gui.py +++ b/usb_util_gui.py @@ -21,6 +21,7 @@ import argparse import os import sys +from pathlib import Path from typing import Any, Dict, List, Optional, Tuple @@ -40,8 +41,9 @@ USB_JSON_PATH = os.path.join(BASE_DIR, "usb_devices.json") _SERVICE_SINGLETON: Optional[UsbSnapshotService] = None +AILAB_ROOT = Path(__file__).resolve().parents[2] AK_GUIPARTS_ROOT = os.path.abspath( - os.path.join(BASE_DIR, "..", "lab_automation_api", "libs", "ak_GUIparts") + str(AILAB_ROOT / "lab_automation_libs" / "gui_parts" / "aist-guiparts") ) if AK_GUIPARTS_ROOT not in sys.path and os.path.isdir(AK_GUIPARTS_ROOT): sys.path.insert(0, AK_GUIPARTS_ROOT)