Skip to content

Commit

Permalink
Fix Makefile
Browse files Browse the repository at this point in the history
- remove cleaning build files, `pip install -e` should be used
- `pip install -e` doesn't work with multiple files, use a for loop to
  install the submodules
  • Loading branch information
thodkatz committed Sep 5, 2024
1 parent cdb2c4a commit 98cf795
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
SHELL=/bin/bash
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TIKTORCH_ENV_NAME ?= tiktorch-server-env

sample_model:
cd tests/data/dummy && zip -r $(ROOT_DIR)/dummy.tmodel ./*

unet2d:
cd tests/data/unet2d && zip -r $(ROOT_DIR)/unet2d.tmodel ./*

unet2d_onnx:
cd tests/data/unet2d_onnx && zip -r $(ROOT_DIR)/onnx.tmodel ./*

dummy_tf:
cd tests/data/dummy_tensorflow && zip -r $(ROOT_DIR)/dummy_tf.tmodel ./*
SUBMODULES = ./vendor/core-bioimage-io-python ./vendor/spec-bioimage-io

protos:
python -m grpc_tools.protoc -I./proto --python_out=tiktorch/proto/ --grpc_python_out=tiktorch/proto/ ./proto/*.proto
Expand All @@ -21,18 +10,22 @@ protos:
version:
python -c "import sys; print(sys.version)"


devenv:
. $$(conda info --base)/etc/profile.d/conda.sh
mamba env create --file environment.yml --name $(TIKTORCH_ENV_NAME)
conda run -n $(TIKTORCH_ENV_NAME) pip install . ./vendor/core-bioimage-io-python ./vendor/spec-bioimage-io
make install_submodules

run_server:
. $$(conda info --base)/etc/profile.d/conda.sh; conda activate $(TIKTORCH_ENV_NAME); python -m tiktorch.server

install_submodules:
@echo "Installing submodules $(SUBMODULES)"
@for package in $(SUBMODULES) ; do \
conda run -n $(TIKTORCH_ENV_NAME) pip install -e $$package ; \
done

remove_devenv:
conda env remove --yes --name $(TIKTORCH_ENV_NAME)


.PHONY: protos version sample_model devenv remove_devenv dummy_tf
.PHONY: *

0 comments on commit 98cf795

Please sign in to comment.