Skip to content

Commit

Permalink
整理: nuitka の名残りを削除 (#1378)
Browse files Browse the repository at this point in the history
* refactor: nuitka の名残りを削除する

* refactor: 実装詳細を外部に記述するコメントを削除

* refactor: nuitka に由来する ignore を削除

* Update voicevox_engine/utility/path_utility.py

---------

Co-authored-by: Hiroshiba <hihokaruta@gmail.com>
  • Loading branch information
tarepan and Hiroshiba authored Jun 2, 2024
1 parent 03c6c64 commit ecbff34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# VOICEVOX specifics
## Artifacts of nuitka
*.dist
*.build
/build
/cache
## Artifact of generating licenses
/licenses.json
licenses_venv/
Expand Down
13 changes: 2 additions & 11 deletions voicevox_engine/utility/path_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ def engine_root() -> Path:
if _is_development():
# git レポジトリのルートを指している
root_dir = Path(__file__).parents[2]

# Nuitka/Pyinstallerでビルドされている場合
else:
root_dir = Path(sys.argv[0]).parent

Expand All @@ -31,17 +29,10 @@ def engine_manifest_path() -> Path:
def _is_development() -> bool:
"""
動作環境が開発版であるか否かを返す。
Nuitka/Pyinstallerでコンパイルされていない場合は開発環境とする。
Pyinstallerでコンパイルされていない場合は開発環境とする。
"""
# nuitkaビルドをした際はグローバルに__compiled__が含まれる
if "__compiled__" in globals():
return False

# pyinstallerでビルドをした際はsys.frozenが設定される
elif getattr(sys, "frozen", False):
return False

return True
return False if getattr(sys, "frozen", False) else True


def get_save_dir() -> Path:
Expand Down

0 comments on commit ecbff34

Please sign in to comment.