Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the makefile work with Poetry v2 as well as v2 #964

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RUN = poetry -C backend run
RUN = cd backend && poetry run
VERSION = $(shell poetry -C backend version -s)
ROOTDIR = $(shell pwd)
SCHEMADIR = $(ROOTDIR)/backend/src/monarch_py/datamodels
Expand Down Expand Up @@ -78,7 +78,7 @@ install-frontend:
.PHONY: model
model: install-backend
$(RUN) gen-pydantic --extra-fields allow $(SCHEMADIR)/model.yaml > $(SCHEMADIR)/model.py
$(RUN) gen-typescript $(SCHEMADIR)/model.yaml > frontend/src/api/model.ts
$(RUN) gen-typescript $(SCHEMADIR)/model.yaml > $(ROOTDIR)/frontend/src/api/model.ts
make format


Expand All @@ -90,36 +90,36 @@ docs/Data-Model:
.PHONY: docs
docs: install-backend docs/Data-Model
$(RUN) gen-doc -d $(ROOTDIR)/docs/Data-Model/ $(SCHEMADIR)/model.yaml
$(RUN) typer backend/src/monarch_py/cli.py utils docs --name monarch --output docs/Usage/CLI.md
$(RUN) mkdocs build
$(RUN) typer $(ROOTDIR)/backend/src/monarch_py/cli.py utils docs --name monarch --output $(ROOTDIR)/docs/Usage/CLI.md
$(RUN) mkdocs build -f ../mkdocs.yaml


### Data/Fixtures ###

.PHONY: fixtures
fixtures:
@echo "Generating fixtures and data..."
$(RUN) python scripts/generate_fixtures.py --all-fixtures
$(RUN) python ../scripts/generate_fixtures.py --all-fixtures
make format


.PHONY: data
data:
@echo "Generating frontpage metadata..."
$(RUN) python scripts/generate_fixtures.py --metadata
$(RUN) python ../scripts/generate_fixtures.py --metadata
@echo "Generating resources data..."
wget https://raw.githubusercontent.com/monarch-initiative/monarch-documentation/main/src/docs/resources/monarch-app-resources.json -O frontend/src/pages/resources/resources.json
make format-frontend

.PHONY: update_publications
update_publications:
@echo "Generating publications data..."
$(RUN) python scripts/get_publications.py update --update-data
$(RUN) python ../scripts/get_publications.py update --update-data

.PHONY: category-enums
category-enums:
@echo "Generating category enums..."
$(RUN) python scripts/generate_category_enums.py
$(RUN) python ../scripts/generate_category_enums.py
make format-backend


Expand All @@ -131,7 +131,7 @@ test: test-backend test-frontend

.PHONY: test-backend
test-backend:
$(RUN) pytest backend/tests
$(RUN) pytest tests


.PHONY: test-frontend
Expand All @@ -150,8 +150,7 @@ dev-frontend: frontend/src/api/model.ts

.PHONY: dev-api
dev-api:
cd backend && \
poetry run uvicorn src.monarch_py.api.main:app --reload
$(RUN) uvicorn src.monarch_py.api.main:app --reload


### Docker ###
Expand Down Expand Up @@ -198,8 +197,8 @@ lint-frontend:

.PHONY: lint-backend
lint-backend:
$(RUN) ruff check --diff --exit-zero backend
$(RUN) black --check --diff -l 120 backend/src backend/tests
$(RUN) ruff check --diff --exit-zero .
$(RUN) black --check --diff -l 120 src tests


.PHONY: format
Expand All @@ -208,8 +207,8 @@ format: format-frontend format-backend

.PHONY: format-backend
format-backend:
$(RUN) ruff check --fix --exit-zero backend
$(RUN) black -l 120 backend/src backend/tests
$(RUN) ruff check --fix --exit-zero .
$(RUN) black -l 120 src tests


.PHONY: format-frontend
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ style = "pep440"


[tool.pytest.ini_options]
pythonpath = ["src"]
pythonpath = [".", "src"]