From 265c7901fe5d386a864762666165c437e5952293 Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:04:21 +0800 Subject: [PATCH 1/3] Update Makefile --- Makefile | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 07226d1..7e9e1e1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,26 @@ .ONESHELL: +.SHELLFLAGS := -c + .PHONY: run .PHONY: uninstall .PHONY: install +.PHONY: install-pre-commit +.PHONY: docker_build +.PHONY: docker_run + + +detect_conda_bin := $(shell bash -c 'if [ "${CONDA_EXE} " == " " ]; then \ + CONDA_EXE=$$((find /opt/conda/bin/conda || find ~/anaconda3/bin/conda || \ + find /usr/local/anaconda3/bin/conda || find ~/miniconda3/bin/conda || \ + find /root/miniconda/bin/conda || find ~/Anaconda3/Scripts/conda || \ + find $$CONDA/bin/conda) 2>/dev/null); fi; \ + if [ "${CONDA_EXE}_" == "_" ]; then \ + echo "Please install Anaconda w/ Python 3.10+ first"; \ + echo "See: https://www.anaconda.com/distribution/"; \ + exit 1; fi; \ + echo $$(dirname $${CONDA_EXE})') + +CONDA_BIN := $(detect_conda_bin) run: uvicorn main:app --reload @@ -10,10 +29,21 @@ uninstall: conda env remove -n backend-api install: - conda env create -f environment.yml + if conda env list | grep -q '^backend-api '; then \ + echo "Environment already exists."; \ + else \ + conda env create -f environment_conda.yml; \ + fi + $(MAKE) install-pre-commit + +install-pre-commit: + /bin/bash -c 'source "${CONDA_BIN}/activate" backend-api && \ + if ! conda list pre-commit | grep pre-commit &> /dev/null; then \ + pip install pre-commit; \ + fi && pre-commit install' docker_build: docker build -t hummingbot/backend-api:latest . docker_run: - docker compose up -d \ No newline at end of file + docker compose up -d From 967a845d3ae0c583b14a725b2fa2a17417c0f9f0 Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:15:03 +0800 Subject: [PATCH 2/3] fix-conda-env --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7e9e1e1..b240cd2 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ install: if conda env list | grep -q '^backend-api '; then \ echo "Environment already exists."; \ else \ - conda env create -f environment_conda.yml; \ + conda env create -f environment.yml; \ fi $(MAKE) install-pre-commit From bcb15ef2d5d772a13311fe4b688c7c113bd5f168 Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:03:04 +0800 Subject: [PATCH 3/3] update python-multipart version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index a9f5e0e..69b97ef 100644 --- a/environment.yml +++ b/environment.yml @@ -14,7 +14,7 @@ dependencies: - git+https://github.com/felixfontein/docker-py - python-dotenv - boto3 - - python-multipart + - python-multipart==0.0.12 - PyYAML - git+https://github.com/hummingbot/hbot-remote-client-py.git - flake8