BTHLABS-0000: bump-version task

Enough with manual version bumps :D
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl>
Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
2025-09-17 18:26:06 +00:00
parent 0ab87e25a4
commit 80fbbcddf3
17 changed files with 766 additions and 22 deletions

View File

@@ -1,3 +1,8 @@
run:
echo: true
pty: true
files_to_version:
- "hotpocket_backend/_meta.py"
- "ops/bin/entrypoint-deployment.sh"
- "package.json"
- "pyproject.toml"

View File

@@ -5,32 +5,33 @@ from __future__ import annotations
import os
from invoke import task
from invoke import Context, task
from invoke.exceptions import UnexpectedExit
from hotpocket_workspace_tools import WorkspaceMode, get_workspace_mode
from hotpocket_workspace_tools.tasks import * # noqa: F401,F403
WORKSPACE_MODE = get_workspace_mode()
ENV = os.getenv('HOTPOCKET_BACKEND_ENV', 'docker')
@task
def clean(ctx):
def clean(ctx: Context):
ctx.run('rm -rf hotpocket_backend/static/')
@task
def test(ctx):
def test(ctx: Context):
ctx.run('pytest -v --disable-warnings')
@task
def flake8(ctx):
def flake8(ctx: Context):
ctx.run('flake8')
@task
def isort(ctx, check=False, diff=False):
def isort(ctx: Context, check=False, diff=False):
command_parts = [
'isort',
]
@@ -47,12 +48,12 @@ def isort(ctx, check=False, diff=False):
@task
def eslint(ctx):
def eslint(ctx: Context):
ctx.run('yarn run eslint')
@task
def lint(ctx):
def lint(ctx: Context):
ihazsuccess = True
try:
@@ -75,17 +76,17 @@ def lint(ctx):
@task
def typecheck(ctx):
def typecheck(ctx: Context):
ctx.run('mypy .')
@task
def django_shell(ctx):
def django_shell(ctx: Context):
ctx.run('python manage.py shell_plus')
@task
def ci(ctx):
def ci(ctx: Context):
ihazsuccess = True
ci_tasks = [test, lint, typecheck]
@@ -100,7 +101,7 @@ def ci(ctx):
@task
def setup(ctx):
def setup(ctx: Context):
ctx.run('python manage.py migrate')
ctx.run('python manage.py create_initial_account hotpocket hotpocketm4st3r')
@@ -109,13 +110,13 @@ def setup(ctx):
@task
def start_web(ctx):
def start_web(ctx: Context):
bind = os.getenv('HOTPOCKET_BACKEND_RUNSERVER_BIND_WEB', '127.0.0.1:8001')
ctx.run(f'python manage.py runserver {bind}')
@task
def start_admin(ctx):
def start_admin(ctx: Context):
bind = os.getenv('HOTPOCKET_BACKEND_RUNSERVER_BIND_ADMIN', '127.0.0.1:8002')
ctx.run(f'python manage.py runserver {bind}', env=dict(
DJANGO_SETTINGS_MODULE=f'hotpocket_backend.settings.{ENV}.admin',
@@ -124,7 +125,7 @@ def start_admin(ctx):
@task
def start_celery_worker(ctx, concurrency=2):
def start_celery_worker(ctx: Context, concurrency=2):
command_parts = [
'celery',
'-A hotpocket_backend.celery:app',
@@ -137,5 +138,5 @@ def start_celery_worker(ctx, concurrency=2):
@task
def start_celery_beat(ctx, schedule_path='run/celery-beat-schedule'):
def start_celery_beat(ctx: Context, schedule_path='run/celery-beat-schedule'):
ctx.run(f'celery -A hotpocket_backend.celery:app beat -l INFO -s {schedule_path}')