Skip to content

Commit

Permalink
Change to uninstall torch related packages when prepare_relase
Browse files Browse the repository at this point in the history
  • Loading branch information
taroushirani committed Aug 3, 2022
1 parent 691566c commit 07f06d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions synthesis/prepare_enunu_release.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import List

KEEP_LATEST_PACKAGES = ['pip', 'setuptools', 'wheel', 'utaupy']
TORCH_PACKAGES= ['torch', 'torchaudio', 'torchvision']
REMOVE_LIST = ['__pycache__', '.mypy']
PYTHON_DIR = 'python-3.8.10-embed-amd64'

Expand All @@ -24,6 +25,13 @@ def pip_install_upgrade(python_exe: str, packages: List[str]):
'--no-warn-script-location'] + packages
subprocess.run(args, check=True)

def pip_uninstall_torch(python_exe: str, packages: List[str]):
"""
pythonのパッケージを更新する
"""
args = [python_exe, '-m', 'pip', 'uninstall'] + packages
subprocess.run(args, check=True)


def remove_cache_files(path_dir, remove_list):
"""
Expand Down Expand Up @@ -127,6 +135,7 @@ def main():
python_exe = join(python_dir, 'python.exe')
print(f'Upgrading packages of {python_dir} (this may take some minutes)')
pip_install_upgrade(python_exe, KEEP_LATEST_PACKAGES)
pip_uninstall_torch(python_exe, TORCH_PACKAGES)
print()

# Pythonの実行ファイルをコピーする
Expand Down

0 comments on commit 07f06d4

Please sign in to comment.