diff --git a/.gitignore b/.gitignore index ac35511..6010f9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .venv/ +.venv-build/ .venv-build-win/ __pycache__/ *.py[cod] @@ -10,7 +11,8 @@ build/ analysis/ *.zip *.tar.gz -# keep vendor/libusb-1.0.dll in repo for Windows bundling -!vendor/libusb-1.0.dll -.venv-build/ hub.log +# keep vendor binaries +!vendor/libusb-1.0.dll +!vendor/wheels/ +!vendor/wheels/*.whl diff --git a/README.md b/README.md index fba98d0..3a097ea 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,14 @@ python -m juc500_xfer info cd juc500 py -3 -m venv .venv .\.venv\Scripts\Activate.ps1 -pip install -r requirements.txt +# vendor\wheels\pyusb-*.whl 사용 (PyPI 불필요) +python -m pip install --no-index --find-links=vendor\wheels -r requirements.txt +pip install -e . python -m juc500_xfer info ``` +또는 `scripts\setup_windows.bat` 실행. + ## 사용법 양쪽 PC에 케이블을 꽂고, **먼저 수신 쪽**, 이어서 송신 쪽을 실행합니다. diff --git a/docs/WINDOWS.md b/docs/WINDOWS.md index d6f7a71..4175d53 100644 --- a/docs/WINDOWS.md +++ b/docs/WINDOWS.md @@ -1,5 +1,20 @@ # Windows 11 설정 +## 소스에서 실행 (오프라인 wheel 포함) + +저장소의 `vendor/wheels/pyusb-1.2.1-py3-none-any.whl` 을 사용합니다. PyPI 접속이 없어도 됩니다. + +```powershell +cd juc500 +py -3 -m venv .venv +.\.venv\Scripts\Activate.ps1 +python -m pip install --no-index --find-links=vendor\wheels -r requirements.txt +pip install -e . +python -m juc500_xfer gui +``` + +또는 `scripts\setup_windows.bat` + ## 설치파일 사용 (권장) 1. `JUC500-Setup-win64.exe` 실행해 설치 diff --git a/pyproject.toml b/pyproject.toml index 031f56d..05d09c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "0.1.0" description = "Apple Silicon Mac ↔ Windows 11 file transfer over j5create JUC500" readme = "README.md" requires-python = ">=3.10" -dependencies = ["pyusb>=1.2.1"] +dependencies = ["pyusb==1.2.1"] [project.scripts] juc500 = "juc500_xfer.cli:main" diff --git a/requirements.txt b/requirements.txt index 65e783e..b059f90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,4 @@ -pyusb>=1.2.1 +# vendor/wheels 의 pyusb wheel을 우선 사용합니다. +# 오프라인: pip install --no-index --find-links=vendor/wheels -r requirements.txt +--find-links=vendor/wheels +pyusb==1.2.1 diff --git a/scripts/setup_macos.sh b/scripts/setup_macos.sh index 589b2ab..285a150 100755 --- a/scripts/setup_macos.sh +++ b/scripts/setup_macos.sh @@ -14,12 +14,15 @@ python3 -m venv .venv # shellcheck disable=SC1091 source .venv/bin/activate pip install -U pip -pip install -r requirements.txt +# vendor wheel 우선 (오프라인 가능) +pip install --no-index --find-links=vendor/wheels -r requirements.txt \ + || pip install --find-links=vendor/wheels -r requirements.txt pip install -e . echo echo "설치 완료. 예:" echo " source $ROOT/.venv/bin/activate" echo " juc500 info" +echo " juc500 gui" echo " juc500 recv -y --dest ~/Downloads" echo " juc500 send /path/to/file" diff --git a/scripts/setup_windows.bat b/scripts/setup_windows.bat index 67bda90..2602f34 100644 --- a/scripts/setup_windows.bat +++ b/scripts/setup_windows.bat @@ -5,12 +5,21 @@ cd /d %~dp0.. py -3 -m venv .venv call .venv\Scripts\activate.bat python -m pip install -U pip -pip install -r requirements.txt -pip install -e . +REM PyPI 없이 vendor\wheels 의 pyusb wheel 사용 +python -m pip install --no-index --find-links=vendor\wheels -r requirements.txt +if errorlevel 1 ( + echo [!] --no-index 실패. find-links + 온라인 허용으로 재시도… + python -m pip install --find-links=vendor\wheels -r requirements.txt +) +python -m pip install --no-index --find-links=vendor\wheels -e . +if errorlevel 1 ( + python -m pip install --find-links=vendor\wheels -e . +) echo. echo Setup done. Next: echo .venv\Scripts\activate echo python -m juc500_xfer info +echo python -m juc500_xfer gui echo See docs\WINDOWS.md for Zadig / WinUSB steps. endlocal diff --git a/vendor/wheels/README.md b/vendor/wheels/README.md new file mode 100644 index 0000000..7212526 --- /dev/null +++ b/vendor/wheels/README.md @@ -0,0 +1,7 @@ +# Place offline Python wheels here for Windows/macOS installs without PyPI. +# Currently vendor'd: +# pyusb-1.2.1-py3-none-any.whl +# pyusb-1.3.1-py3-none-any.whl +# +# Install: +# pip install --no-index --find-links=vendor/wheels -r requirements.txt diff --git a/vendor/wheels/pyusb-1.2.1-py3-none-any.whl b/vendor/wheels/pyusb-1.2.1-py3-none-any.whl new file mode 100644 index 0000000..fc9a0ea Binary files /dev/null and b/vendor/wheels/pyusb-1.2.1-py3-none-any.whl differ diff --git a/vendor/wheels/pyusb-1.3.1-py3-none-any.whl b/vendor/wheels/pyusb-1.3.1-py3-none-any.whl new file mode 100644 index 0000000..89fa172 Binary files /dev/null and b/vendor/wheels/pyusb-1.3.1-py3-none-any.whl differ