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:
Lance Edgar 2023-01-09 09:00:50 -06:00
parent 7d536499d6
commit 492e8da5c3
2 changed files with 14 additions and 0 deletions

View file

@ -12,6 +12,8 @@
[core]
logging_conf_file = ${appdir}/luigi/logging.conf
% if LUIGI2:
# Number of seconds to wait before timing out when making an API call. Defaults
# to 10.0
# (sometimes things can lag for us and we simply need to give it more time)
@ -27,6 +29,8 @@ rpc_retry_attempts = 10
# (occasional network issues seem to cause us to need more/longer retries)
rpc_retry_wait = 60
% endif
[retcode]
# cf. https://luigi.readthedocs.io/en/stable/configuration.html#retcode-config
# The following return codes are the recommended exit codes for Luigi

View file

@ -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),