Skip to content

Commit c908a1d

Browse files
authored
Merge pull request #40 from hummingbot/development
sync / development to master 2.1.0
2 parents a672225 + e3dd94d commit c908a1d

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

Makefile

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
.ONESHELL:
2+
.SHELLFLAGS := -c
3+
24
.PHONY: run
35
.PHONY: uninstall
46
.PHONY: install
7+
.PHONY: install-pre-commit
8+
.PHONY: docker_build
9+
.PHONY: docker_run
10+
11+
12+
detect_conda_bin := $(shell bash -c 'if [ "${CONDA_EXE} " == " " ]; then \
13+
CONDA_EXE=$$((find /opt/conda/bin/conda || find ~/anaconda3/bin/conda || \
14+
find /usr/local/anaconda3/bin/conda || find ~/miniconda3/bin/conda || \
15+
find /root/miniconda/bin/conda || find ~/Anaconda3/Scripts/conda || \
16+
find $$CONDA/bin/conda) 2>/dev/null); fi; \
17+
if [ "${CONDA_EXE}_" == "_" ]; then \
18+
echo "Please install Anaconda w/ Python 3.10+ first"; \
19+
echo "See: https://www.anaconda.com/distribution/"; \
20+
exit 1; fi; \
21+
echo $$(dirname $${CONDA_EXE})')
22+
23+
CONDA_BIN := $(detect_conda_bin)
524

625
run:
726
uvicorn main:app --reload
@@ -10,10 +29,21 @@ uninstall:
1029
conda env remove -n backend-api
1130

1231
install:
13-
conda env create -f environment.yml
32+
if conda env list | grep -q '^backend-api '; then \
33+
echo "Environment already exists."; \
34+
else \
35+
conda env create -f environment.yml; \
36+
fi
37+
$(MAKE) install-pre-commit
38+
39+
install-pre-commit:
40+
/bin/bash -c 'source "${CONDA_BIN}/activate" backend-api && \
41+
if ! conda list pre-commit | grep pre-commit &> /dev/null; then \
42+
pip install pre-commit; \
43+
fi && pre-commit install'
1444

1545
docker_build:
1646
docker build -t hummingbot/backend-api:latest .
1747

1848
docker_run:
19-
docker compose up -d
49+
docker compose up -d

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- git+https://github.com/felixfontein/docker-py
1515
- python-dotenv
1616
- boto3
17-
- python-multipart
17+
- python-multipart==0.0.12
1818
- PyYAML
1919
- git+https://github.com/hummingbot/hbot-remote-client-py.git
2020
- flake8

0 commit comments

Comments
 (0)