config refactor, renames

This commit is contained in:
Zsolt Ero
2024-08-29 01:50:52 +02:00
parent 939b782830
commit f55d9f1c8b
10 changed files with 34 additions and 20 deletions

View File

@@ -1,7 +1,6 @@
import os
import subprocess
import sys
import time
from pathlib import Path
import requests
@@ -57,3 +56,14 @@ def download_file_aria2(url: str, local_file: Path):
],
check=True,
)
def python_venv_executable() -> Path:
venv_path = os.environ.get('VIRTUAL_ENV')
if venv_path:
return Path(venv_path) / 'bin' / 'python'
elif sys.prefix != sys.base_prefix:
return Path(sys.prefix) / 'bin' / 'python'
else:
return Path(sys.executable)