Commit 46581833 authored by echel0n's avatar echel0n

Refactored requirements.txt to be conditional on python version

parent f94b06d1
......@@ -14,15 +14,18 @@ chardet==3.0.4
click==7.1.2
cloudscraper==1.2.46
configobj==5.0.6
cryptography==3.0
cryptography==3.0; python_version >= "3.6"
cryptography==2.1.4; python_version < "3.6"
decorator==4.4.2
deluge-client==1.9.0
dirsync==2.2.5
dogpile.cache==0.9.2
dogpile.cache==1.0.2; python_version >= "3.6"
dogpile.cache==0.9.2; python_version < "3.6"
ecdsa==0.14.1
enzyme==0.4.1
fake-useragent==0.1.11
feedparser==5.2.1
feedparser==6.0.0b3; python_version >= "3.6"
feedparser==5.2.1; python_version < "3.6"
future==0.18.2
gntp==1.0.3
guessit==3.1.1
......@@ -44,7 +47,8 @@ oauth2==1.9.0.post1
oauthlib==3.1.0
packaging==20.4
pbr==5.4.5
Pint==0.9
Pint==0.14; python_version >= "3.6"
Pint==0.9; python_version < "3.6"
profilehooks==1.11.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
......@@ -76,7 +80,8 @@ simplejson==3.17.2
six==1.15.0
soupsieve==2.0.1
SQLAlchemy==1.3.18
stevedore==1.32.0
stevedore==3.2.0; python_version >= "3.6"
stevedore==1.32.0; python_version < "3.6"
subliminal==2.1.0
tornado==6.0.4
twilio==6.44.2
......
......@@ -179,7 +179,6 @@ def check_requirements():
if sys.version_info < (3, 5, 0):
sys.exit("Sorry, SiCKRAGE requires Python 3.5+")
# install/update requirements
if os.path.exists(REQS_FILE):
with open(REQS_FILE) as f:
for line in f.readlines():
......@@ -187,10 +186,10 @@ 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", "--no-use-pep517", "--no-deps", "--no-cache-dir", line.strip()])
subprocess.check_call([sys.executable, "-m", "pip", "install", "--no-deps", "--no-cache-dir", line.strip()])
except pkg_resources.DistributionNotFound:
print('Installing requirement {}'.format(line.strip()))
subprocess.check_call([sys.executable, "-m", "pip", "install", "--no-use-pep517", "--no-deps", "--no-cache-dir", line.strip()])
subprocess.check_call([sys.executable, "-m", "pip", "install", "--no-deps", "--no-cache-dir", line.strip()])
except ValueError:
continue
......
......@@ -352,10 +352,9 @@ class UpdateManager(object):
os.unlink(requirements_file.name)
return False
output, __, exit_status = self._pip_cmd('install --no-use-pep517 --no-deps --no-cache-dir -r {}'.format(requirements_file.name))
output, __, exit_status = self._pip_cmd('install --no-deps --no-cache-dir -r {}'.format(requirements_file.name))
if exit_status != 0:
__, __, exit_status = self._pip_cmd('install --no-use-pep517 --no-deps --no-cache-dir --user -r {}'.format(requirements_file.name))
__, __, exit_status = self._pip_cmd('install --no-use-pep517 --no-deps --no-cache-dir -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