mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
data_migrations -> migrations
This commit is contained in:
parent
ebf9d522e0
commit
248d7f5678
8 changed files with 10 additions and 10 deletions
10
src/tools.py
10
src/tools.py
|
@ -933,12 +933,12 @@ def _get_migrations_list():
|
|||
migrations = []
|
||||
|
||||
try:
|
||||
from . import data_migrations
|
||||
from . import migrations
|
||||
except ImportError:
|
||||
# not data migrations present, return empty list
|
||||
return migrations
|
||||
|
||||
migrations_path = data_migrations.__path__[0]
|
||||
migrations_path = migrations.__path__[0]
|
||||
|
||||
if not os.path.exists(migrations_path):
|
||||
logger.warn(m18n.n("migrations_cant_reach_migration_file", migrations_path))
|
||||
|
@ -973,11 +973,11 @@ def _get_migration_by_name(migration_name):
|
|||
"""
|
||||
|
||||
try:
|
||||
from . import data_migrations
|
||||
from . import migrations
|
||||
except ImportError:
|
||||
raise AssertionError("Unable to find migration with name %s" % migration_name)
|
||||
|
||||
migrations_path = data_migrations.__path__[0]
|
||||
migrations_path = migrations.__path__[0]
|
||||
migrations_found = [
|
||||
x
|
||||
for x in os.listdir(migrations_path)
|
||||
|
@ -1001,7 +1001,7 @@ def _load_migration(migration_file):
|
|||
# this is python builtin method to import a module using a name, we
|
||||
# use that to import the migration as a python object so we'll be
|
||||
# able to run it in the next loop
|
||||
module = import_module("yunohost.data_migrations.{}".format(migration_id))
|
||||
module = import_module("yunohost.migrations.{}".format(migration_id))
|
||||
return module.MyMigration(migration_id)
|
||||
except Exception as e:
|
||||
import traceback
|
||||
|
|
|
@ -26,7 +26,7 @@ def find_expected_string_keys():
|
|||
|
||||
python_files = glob.glob("src/*.py")
|
||||
python_files.extend(glob.glob("src/utils/*.py"))
|
||||
python_files.extend(glob.glob("src/data_migrations/*.py"))
|
||||
python_files.extend(glob.glob("src/migrations/*.py"))
|
||||
python_files.extend(glob.glob("src/authenticators/*.py"))
|
||||
python_files.extend(glob.glob("src/diagnosis/*.py"))
|
||||
python_files.append("bin/yunohost")
|
||||
|
@ -63,7 +63,7 @@ def find_expected_string_keys():
|
|||
]
|
||||
|
||||
# For each migration, expect to find "migration_description_<name>"
|
||||
for path in glob.glob("src/data_migrations/*.py"):
|
||||
for path in glob.glob("src/migrations/*.py"):
|
||||
if "__init__" in path:
|
||||
continue
|
||||
yield "migration_description_" + os.path.basename(path)[:-3]
|
||||
|
|
|
@ -27,7 +27,7 @@ def find_expected_string_keys():
|
|||
|
||||
python_files = glob.glob("src/*.py")
|
||||
python_files.extend(glob.glob("src/utils/*.py"))
|
||||
python_files.extend(glob.glob("src/data_migrations/*.py"))
|
||||
python_files.extend(glob.glob("src/migrations/*.py"))
|
||||
python_files.extend(glob.glob("src/authenticators/*.py"))
|
||||
python_files.extend(glob.glob("src/diagnosis/*.py"))
|
||||
python_files.append("bin/yunohost")
|
||||
|
@ -64,7 +64,7 @@ def find_expected_string_keys():
|
|||
]
|
||||
|
||||
# For each migration, expect to find "migration_description_<name>"
|
||||
for path in glob.glob("src/data_migrations/*.py"):
|
||||
for path in glob.glob("src/migrations/*.py"):
|
||||
if "__init__" in path:
|
||||
continue
|
||||
yield "migration_description_" + os.path.basename(path)[:-3]
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -12,4 +12,4 @@ commands =
|
|||
py39-invalidcode: flake8 src data --exclude src/tests,src/vendor --select F,E722,W605
|
||||
py39-black-check: black --check --diff src doc data tests
|
||||
py39-black-run: black src doc data tests
|
||||
py39-mypy: mypy --ignore-missing-import --install-types --non-interactive --follow-imports silent src/ --exclude (acme_tiny|data_migrations)
|
||||
py39-mypy: mypy --ignore-missing-import --install-types --non-interactive --follow-imports silent src/ --exclude (acme_tiny|migrations)
|
||||
|
|
Loading…
Add table
Reference in a new issue