Commit ec9cb23f authored by echel0n's avatar echel0n

Added `--no-use-pep517` to pip commands for installing requirements

parent cb7d4258
......@@ -47,6 +47,7 @@ REQS_FILE = os.path.join(MAIN_DIR, 'requirements.txt')
CHECKSUM_FILE = os.path.join(PROG_DIR, 'checksums.md5')
AUTO_PROCESS_TV_CFG_FILE = os.path.join(*[PROG_DIR, 'autoProcessTV', 'autoProcessTV.cfg'])
class Daemon(object):
"""
Usage: subclass the Daemon class
......@@ -186,10 +187,14 @@ def check_requirements():
req_name, req_version = line.strip().split('==')
if not pkg_resources.get_distribution(req_name).version == req_version:
print('Updating requirement {} to {}'.format(req_name, req_version))
subprocess.check_call([sys.executable, "-m", "pip", "install", "--ignore-installed", "--no-cache-dir", line.strip()])
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "--no-use-pep517", "--ignore-installed", "--no-cache-dir", line.strip()]
)
except pkg_resources.DistributionNotFound:
print('Installing requirement {}'.format(line.strip()))
subprocess.check_call([sys.executable, "-m", "pip", "install", "--ignore-installed", "--no-cache-dir", line.strip()])
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "--no-use-pep517", "--ignore-installed", "--no-cache-dir", line.strip()]
)
except ValueError:
continue
......
......@@ -298,7 +298,8 @@ class SRDatabase(object):
backup_dict = {
'schema': {},
'indexes': {},
'data': {}
'data': {},
'version': self.version
}
for table_name, table_object in meta.tables.items():
......
......@@ -352,10 +352,10 @@ class UpdateManager(object):
os.unlink(requirements_file.name)
return False
output, __, exit_status = self._pip_cmd('install --ignore-installed --no-cache-dir -r {}'.format(requirements_file.name))
output, __, exit_status = self._pip_cmd('install --no-use-pep517 --ignore-installed --no-cache-dir -r {}'.format(requirements_file.name))
if exit_status != 0:
__, __, exit_status = self._pip_cmd('install --ignore-installed --no-cache-dir --user -r {}'.format(requirements_file.name))
__, __, exit_status = self._pip_cmd('install --no-use-pep517 --ignore-installed --no-cache-dir --user -r {}'.format(requirements_file.name))
if exit_status == 0:
requirements_file.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment