@contextmanager
def update_changed_requirements():
 reqs_path = join(env.proj_path, env.reqs_path)
 get_reqs = (lambda : run((u'cat %s' % reqs_path), show=False))
 old_reqs = (get_reqs() if env.reqs_path else u'')
 (yield)
 if old_reqs:
  new_reqs = get_reqs()
  if (old_reqs == new_reqs):
   for req in new_reqs.split(u'\n'):
    if req.startswith(u'-e'):
     if (u'@' not in req):
      break
    elif (req.strip() and (not req.startswith(u'#'))):
     if (not (set(u'>=<') & set(req))):
      break
   else:
    return
  pip((u'-r %s/%s' % (env.proj_path, env.reqs_path)))

@ contextmanager def update_changed_requirements ( ) : reqs_path = join ( env . proj_path , env . reqs_path ) get_reqs = ( lambda : run ( ( u'cat %s' % reqs_path ) , show = False ) ) old_reqs = ( get_reqs ( ) if env . reqs_path else u'' ) ( yield ) if old_reqs : new_reqs = get_reqs ( ) if ( old_reqs == new_reqs ) : for req in new_reqs . split ( u'\n' ) : if req . startswith ( u'-e' ) : if ( u'@' not in req ) : break elif ( req . strip ( ) and ( not req . startswith ( u'#' ) ) ) : if ( not ( set ( u'>=<' ) & set ( req ) ) ) : break else : return pip ( ( u'-r %s/%s' % ( env . proj_path , env . reqs_path ) ) )
checks for changes in the requirements file across an update .