Skip to content

Commit

Permalink
refactor: add poetry as a dependency in the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
aricma committed Jan 14, 2024
1 parent 635c202 commit 4e0febc
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ dev: build server

build: reset statics dummy-data

new-dummy-data: dummy-data
# --- dummy data ---------------------------------------------------------------

dummy-data:
dummy-data: resolve-poetry
poetry run python dummy_data/make_random_tasks.py

# ------------------------------------------------------------------------------

refactor:
refactor: resolve-poetry
poetry run black .
poetry run ruff --fix

lint:
lint: resolve-poetry
poetry run ruff check
poetry run mypy business_logic
poetry run mypy web_interface
poetry run mypy server

tests:
tests: resolve-poetry
poetry run pytest business_logic --noconftest

.PHONY: server
server:
server: resolve-poetry
STATIC_FOLDER_NAME=$(static_folder_name) \
PATH_TO_TASK_DUMMY_DATA=$(path_to_task_dummy_data) \
poetry run uvicorn server.__main__:app --reload
Expand Down Expand Up @@ -63,6 +63,15 @@ reset: reset-statics
reset-statics:
rm -rf $(static_folder_name)

# --- dependencies -------------------------------------------------------------

resolve-poetry:
ifeq (, $(shell which poetry))
@echo "installing poetry v1.6.1..."
pip install poetry==1.6.1
endif
@echo "poetry resolved"

# --- functions ----------------------------------------------------------------

# "build" will run the given 1 and pipe the stdout of 1 into 2 if 1 finishes without errors
Expand Down

0 comments on commit 4e0febc

Please sign in to comment.