Prefer portable output directory in standalone builds (スタンドアロン版でポータブル出力ディレクトリを優先)#22
Merged
maple60 merged 1 commit intoApr 2, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
output/directory next to the app/executable when that location is writable to match user expectations.Description
_frozen_portable_base_dir()to compute a portable base directory nearsys.executable, including.appbundle handling on macOS.get_output_base_dir()to prefer the portable base for frozen apps when_is_writable_dir()returns true and otherwise fall back to the OS user data directory returned byuser_data_dir().README.mdandREADME_ja.md.Testing
src/leaf_contour_efd/utils/paths.pyusingPYENV_VERSION=3.11.14 python -m compileall, which succeeded..python-versionnot matching an installed Python, which is an environment issue and not a code error.src/leaf_contour_efd/utils/paths.py,README.md, andREADME_ja.mdwere updated.(Japanese)
Motivation
output/を作成できるようにするためです。Description
sys.executableの近傍をベースにする_frozen_portable_base_dir()を追加し、macOS の.appバンドルも考慮します。get_output_base_dir()を変更して、frozen 時はまずポータブルなベースを試し書き込み可であればそれを返し、不可ならユーザーデータ領域へフォールバックするようにしました。README.mdとREADME_ja.mdにスタンドアロンでの振る舞いを追記しました。Testing
PYENV_VERSION=3.11.14 python -m compileall src/leaf_contour_efd/utils/paths.pyにより構文チェックを行い成功しました。python -m compileall実行は環境の.python-versionとインストール済み Python が一致せず失敗しましたが、これは環境依存の問題でコード不備ではありません。src/leaf_contour_efd/utils/paths.py、README.md、README_ja.mdです。Codex Task