Skip to content

Commit

Permalink
Fix Makefile (#9)
Browse files Browse the repository at this point in the history
* fix things in makefile

* chore: delete ports from makefile

* refactor: make commands in order
  • Loading branch information
Ramimashkouk authored Feb 19, 2024
1 parent 106d865 commit 9466c13
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
49 changes: 26 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SHELL = /bin/bash

PYTHON = python3
FRONTEND_PATH = ./df_designer_front
BACKEND_DIR = df_designer

.PHONY: help
help:
Expand All @@ -20,7 +21,7 @@ env_frontend:

.PHONY: clean_env_frontend
clean_env_frontend:
cd ${FRONTEND_PATH} && rm -rf
cd ${FRONTEND_PATH} && rm -rf node_modules

.PHONY: build_frontend
build_frontend: env_frontend
Expand All @@ -30,8 +31,8 @@ build_frontend: env_frontend
run_frontend: env_frontend
cd ${FRONTEND_PATH} && npm start

.PHONY: dev_frontend
dev_frontend: env_frontend
.PHONY: run_dev_frontend
run_dev_frontend: env_frontend
make run_frontend


Expand All @@ -46,14 +47,17 @@ env_backend:
clean_env_backend:
poetry env remove --all

.PHONY: build_backend
build_backend: env_backend
poetry build

.PHONY: run_backend
run_backend:
poetry run python -m df_designer run-app --cmd-to-run="ping ya.ru"
run_backend: env_backend
poetry run python -m ${BACKEND_DIR} run-app --cmd-to-run="ping ya.ru" --conf-reload="False"

.PHONY: run_dev_backend
run_dev_backend:
poetry shell
# TODO ...
run_dev_backend: env_backend
poetry run python -m ${BACKEND_DIR} run-app --cmd-to-run="ping ya.ru"



Expand All @@ -64,26 +68,25 @@ env:
make env_frontend
make env_backend

.PHONY: run_app
run_app:
make build_frontend
make run_backend

.PHONY: run_dev
run_dev:
make build_frontend
make run_dev_backend
.PHONY: clean_env
clean_env:
make clean_env_frontend
make clean_env_backend

.PHONY: build
build:
build: env
make build_frontend
# TODO build wheel
make build_backend

.PHONY: clean
clean:
make clean_env_frontend
make clean_env_backend
.PHONY: run_app
run_app: env
make run_frontend
make run_backend

.PHONY: run_dev
run_dev: env
make run_dev_frontend
make run_dev_backend



Expand Down
3 changes: 2 additions & 1 deletion df_designer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def run_app(
port: int = app.conf_port,
dir_logs: str = app.dir_logs,
cmd_to_run: str = app.cmd_to_run,
conf_reload: str = str(app.conf_reload),
):
"""Run the application."""
app.cmd_to_run = cmd_to_run
Expand All @@ -36,7 +37,7 @@ def run_app(
host=ip_address,
port=port,
log_level=app.conf_log_level,
reload=app.conf_reload,
reload=conf_reload.lower() in ["true", "yes", "t", "y", "1"],
)
server = uvicorn.Server(config)
server.run()
Expand Down

0 comments on commit 9466c13

Please sign in to comment.