Remove some luigi config if using newer package
apparently some of these settings are no longer used by latest luigi, and it complains when they're present
This commit is contained in:
parent
7d536499d6
commit
492e8da5c3
2 changed files with 14 additions and 0 deletions
|
@ -25,6 +25,8 @@ Fabric library for Luigi apps
|
|||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
from pkg_resources import parse_version
|
||||
|
||||
from rattail_fabric2 import postgresql, make_deploy, mkdir
|
||||
|
||||
|
@ -48,6 +50,14 @@ def install_luigi(c, envroot, luigi='luigi', user='rattail',
|
|||
c.sudo("""bash -lc "workon {} && pip install '{}'" """.format(envname, luigi),
|
||||
user=user)
|
||||
|
||||
# detect luigi version
|
||||
LUIGI2 = False
|
||||
output = c.sudo("bash -lc 'workon {} && pip show luigi | grep Version'".format(envname), user=user).stdout.strip()
|
||||
match = re.match(r'^Version: (\d+\S+)$', output)
|
||||
if match:
|
||||
if parse_version(match.group(1)) < parse_version('3'):
|
||||
LUIGI2 = True
|
||||
|
||||
# dirs
|
||||
mkdir(c, ['{}/luigi'.format(appdir),
|
||||
'{}/luigi/log'.format(appdir),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue