Enable venv on the fly

This commit is contained in:
henryruhs
2024-01-28 20:35:36 +01:00
parent f1c7b3d6c9
commit 6fb23fe747
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
#!/usr/bin/env python3
import subprocess
import sys
import subprocess
if __name__ == '__main__':
if 'venv' in sys.executable or 'conda' in sys.executable:
if 'venv' in sys.executable or '--skip-venv' in sys.argv:
from facefusion import core
core.cli()
else:
try:
subprocess.run([ 'venv/bin/python', 'run.py' ])
except KeyboardInterrupt:
except:
sys.exit()
+2 -2
View File
@@ -16,7 +16,7 @@ def before_all() -> None:
def test_image_to_image() -> None:
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.jpg', '-o', '.assets/examples', '--headless' ]
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.jpg', '-o', '.assets/examples', '--headless', '--skip-venv' ]
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
assert run.returncode == 0
@@ -24,7 +24,7 @@ def test_image_to_image() -> None:
def test_image_to_video() -> None:
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless' ]
commands = [ sys.executable, 'run.py', '-s', '.assets/examples/source.jpg', '-t', '.assets/examples/target-1080p.mp4', '-o', '.assets/examples', '--trim-frame-end', '10', '--headless', '--skip-venv' ]
run = subprocess.run(commands, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
assert run.returncode == 0