def find_migrate_repo(package=None, repo_name='migrate_repo'): package = package or sql path = os.path.abspath(os.path.join( os.path.dirname(package.__file__), repo_name)) if os.path.isdir(path): return path raise exception.MigrationNotProvided(package.__name__, path)
def find_repo(repo_name): """Return the absolute path to the named repository.""" path = os.path.abspath(os.path.join( os.path.dirname(sql.__file__), repo_name)) if not os.path.isdir(path): raise exception.MigrationNotProvided(sql.__name__, path) return path
def _get_migrate_repo_path(branch): abs_path = os.path.abspath( os.path.join( os.path.dirname(sql.__file__), 'legacy_migrations', f'{branch}_repo', ) ) if not os.path.isdir(abs_path): raise exception.MigrationNotProvided(sql.__name__, abs_path) return abs_path