mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Limit py-consul version depending on python version (#3336)
Latest release is incompatible with python < 3.9
This commit is contained in:
@@ -27,12 +27,17 @@ def install_requirements(what):
|
||||
requirements += ['psycopg[binary]'] if sys.version_info >= (3, 8, 0) and\
|
||||
(sys.platform != 'darwin' or what == 'etcd3') else ['psycopg2-binary==2.9.9'
|
||||
if sys.platform == 'darwin' else 'psycopg2-binary']
|
||||
|
||||
from pip._vendor.distlib.markers import evaluator, DEFAULT_CONTEXT
|
||||
from pip._vendor.distlib.util import parse_requirement
|
||||
|
||||
for r in read('requirements.txt').split('\n'):
|
||||
r = r.strip()
|
||||
if r != '':
|
||||
extras = {e for e, v in EXTRAS_REQUIRE.items() if v and any(r.startswith(x) for x in v)}
|
||||
if not extras or what == 'all' or what in extras:
|
||||
requirements.append(r)
|
||||
r = parse_requirement(r)
|
||||
if not r or r.marker and not evaluator.evaluate(r.marker, DEFAULT_CONTEXT):
|
||||
continue
|
||||
extras = {e for e, v in EXTRAS_REQUIRE.items() if v and any(r.requirement.startswith(x) for x in v)}
|
||||
if not extras or what == 'all' or what in extras:
|
||||
requirements.append(r.requirement)
|
||||
|
||||
return subprocess.call([sys.executable, '-m', 'pip', 'install'] + requirements)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user