2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 18:45:40 +00:00

Add namespaces to tasks (#7904)

* Namespaces for invoke tasks
Fixes #7852

* adjust various places that call re-namespaced tasks

* use full invoke command
easier for future refactors

* fix call name

* move worker to int

* adapt calls in tasks

* fix changed path

* ignore localhost links

* Avoid using internal names
This commit is contained in:
Matthias Mair
2024-09-05 05:04:57 +02:00
committed by GitHub
parent 690308d032
commit e3205184be
22 changed files with 112 additions and 58 deletions

View File

@ -11,7 +11,7 @@ from pathlib import Path
from platform import python_version
from typing import Optional
from invoke import task
from invoke import Collection, task
def checkPythonVersion():
@ -367,7 +367,7 @@ def translate_stats(c):
The file generated from this is needed for the UI.
"""
# Recompile the translation files (.mo)
# We do not run 'invoke translate' here, as that will touch the source (.po) files too!
# We do not run 'invoke dev.translate' here, as that will touch the source (.po) files too!
try:
manage(c, 'compilemessages', pty=True)
except Exception:
@ -1431,7 +1431,7 @@ def docs_server(c, address='localhost:8080', compile_schema=False):
@task
def clear_generated(c):
"""Clear generated files from `inv update`."""
"""Clear generated files from `invoke update`."""
# pyc/pyo files
run(c, 'find . -name "*.pyc" -exec rm -f {} +')
run(c, 'find . -name "*.pyo" -exec rm -f {} +')
@ -1441,3 +1441,54 @@ def clear_generated(c):
# Generated translations
run(c, 'find . -name "django.mo" -exec rm -f {} +')
run(c, 'find . -name "messages.mo" -exec rm -f {} +')
# Collection sorting
development = Collection(
delete_data,
docs_server,
frontend_dev,
gunicorn,
import_fixtures,
schema,
server,
setup_dev,
setup_test,
test,
test_translations,
translate,
)
internal = Collection(
clean_settings,
clear_generated,
export_settings_definitions,
frontend_build,
frontend_check,
frontend_compile,
frontend_install,
frontend_trans,
render_js_files,
rebuild_models,
rebuild_thumbnails,
showmigrations,
translate_stats,
worker,
)
ns = Collection(
backup,
export_records,
frontend_download,
import_records,
install,
migrate,
plugins,
remove_mfa,
restore,
static,
superuser,
update,
version,
wait,
)
ns.add_collection(development, 'dev')
ns.add_collection(internal, 'int')