Migrate to conda (#461)
* Migrate from venv to conda * Migrate from venv to conda
This commit is contained in:
parent
02cca313aa
commit
6fd53b9229
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -30,6 +30,6 @@ jobs:
|
|||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
- run: python install.py --onnxruntime default --skip-venv
|
- run: python install.py --onnxruntime default --skip-conda
|
||||||
- run: pip install pytest
|
- run: pip install pytest
|
||||||
- run: pytest
|
- run: pytest
|
||||||
|
@ -187,6 +187,7 @@ def apply_args(program : ArgumentParser) -> None:
|
|||||||
def run(program : ArgumentParser) -> None:
|
def run(program : ArgumentParser) -> None:
|
||||||
apply_args(program)
|
apply_args(program)
|
||||||
logger.init(facefusion.globals.log_level)
|
logger.init(facefusion.globals.log_level)
|
||||||
|
|
||||||
if facefusion.globals.system_memory_limit > 0:
|
if facefusion.globals.system_memory_limit > 0:
|
||||||
limit_system_memory(facefusion.globals.system_memory_limit)
|
limit_system_memory(facefusion.globals.system_memory_limit)
|
||||||
if facefusion.globals.force_download:
|
if facefusion.globals.force_download:
|
||||||
|
@ -9,6 +9,9 @@ from argparse import ArgumentParser, HelpFormatter
|
|||||||
|
|
||||||
from facefusion import metadata, wording
|
from facefusion import metadata, wording
|
||||||
|
|
||||||
|
if platform.system().lower() == 'darwin':
|
||||||
|
os.environ['SYSTEM_VERSION_COMPAT'] = '0'
|
||||||
|
|
||||||
ONNXRUNTIMES : Dict[str, Tuple[str, str]] = {}
|
ONNXRUNTIMES : Dict[str, Tuple[str, str]] = {}
|
||||||
|
|
||||||
if platform.system().lower() == 'darwin':
|
if platform.system().lower() == 'darwin':
|
||||||
@ -28,7 +31,7 @@ if platform.system().lower() == 'windows':
|
|||||||
def cli() -> None:
|
def cli() -> None:
|
||||||
program = ArgumentParser(formatter_class = lambda prog: HelpFormatter(prog, max_help_position = 130))
|
program = ArgumentParser(formatter_class = lambda prog: HelpFormatter(prog, max_help_position = 130))
|
||||||
program.add_argument('--onnxruntime', help = wording.get('help.install_dependency').format(dependency = 'onnxruntime'), choices = ONNXRUNTIMES.keys())
|
program.add_argument('--onnxruntime', help = wording.get('help.install_dependency').format(dependency = 'onnxruntime'), choices = ONNXRUNTIMES.keys())
|
||||||
program.add_argument('--skip-venv', help = wording.get('help.skip_venv'), action = 'store_true')
|
program.add_argument('--skip-conda', help = wording.get('help.skip_conda'), action = 'store_true')
|
||||||
program.add_argument('-v', '--version', version = metadata.get('name') + ' ' + metadata.get('version'), action = 'version')
|
program.add_argument('-v', '--version', version = metadata.get('name') + ' ' + metadata.get('version'), action = 'version')
|
||||||
run(program)
|
run(program)
|
||||||
|
|
||||||
@ -37,10 +40,8 @@ def run(program : ArgumentParser) -> None:
|
|||||||
args = program.parse_args()
|
args = program.parse_args()
|
||||||
python_id = 'cp' + str(sys.version_info.major) + str(sys.version_info.minor)
|
python_id = 'cp' + str(sys.version_info.major) + str(sys.version_info.minor)
|
||||||
|
|
||||||
if platform.system().lower() == 'darwin':
|
if not args.skip_conda and 'CONDA_PREFIX' not in os.environ:
|
||||||
os.environ['SYSTEM_VERSION_COMPAT'] = '0'
|
sys.exit(1)
|
||||||
if not args.skip_venv:
|
|
||||||
os.environ['PIP_REQUIRE_VIRTUALENV'] = '1'
|
|
||||||
if args.onnxruntime:
|
if args.onnxruntime:
|
||||||
answers =\
|
answers =\
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ WORDING : Dict[str, Any] =\
|
|||||||
{
|
{
|
||||||
# installer
|
# installer
|
||||||
'install_dependency': 'select the variant of {dependency} to install',
|
'install_dependency': 'select the variant of {dependency} to install',
|
||||||
'skip_venv': 'skip the virtual environment check',
|
'skip_conda': 'skip the conda environment check',
|
||||||
# general
|
# general
|
||||||
'source': 'choose single or multiple source images or audios',
|
'source': 'choose single or multiple source images or audios',
|
||||||
'target': 'choose single target image or video',
|
'target': 'choose single target image or video',
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
os.environ['PIP_BREAK_SYSTEM_PACKAGES'] = '1'
|
||||||
subprocess.call([ 'pip', 'install' , 'inquirer', '-q' ])
|
subprocess.call([ 'pip', 'install' , 'inquirer', '-q' ])
|
||||||
|
|
||||||
from facefusion import installer
|
from facefusion import installer
|
||||||
|
Loading…
Reference in New Issue
Block a user