Skip to content

Commit

Permalink
Merge pull request #40 from hummingbot/development
Browse files Browse the repository at this point in the history
sync / development to master 2.1.0
  • Loading branch information
rapcmia authored Oct 28, 2024
2 parents a672225 + e3dd94d commit c908a1d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
34 changes: 32 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.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
docker compose up -d
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c908a1d

Please sign in to comment.