-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (30 loc) · 1.1 KB
/
Makefile
File metadata and controls
31 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.PHONY: testenv
testenv:
docker run \
--rm -it \
-v $(PWD):/tmp/talon-client \
-w /tmp/talon-client/ \
python:3.7.13-slim-buster \
/bin/bash -c "pip install -r requirements.txt; pip install -r test-requirements.txt; /bin/bash"
apply-sed-changes:
@echo "Applying datetime patch..."
@for f in \
talon_one/models/account_dashboard_statistic_discount.py \
talon_one/models/account_dashboard_statistic_loyalty_points.py \
talon_one/models/account_dashboard_statistic_referrals.py \
talon_one/models/account_dashboard_statistic_revenue.py; do \
if [ ! -f "$$f" ]; then \
echo "Warning: $$f not found, skipping" >&2; \
continue; \
fi; \
tmp_file="$$f.tmp.$$"; \
sed \
-e 's/^from datetime import datetime$$/import datetime as datetime_module/' \
-e 's/datetime: datetime =/datetime: datetime_module.datetime =/' \
"$$f" >"$$tmp_file"; \
mv "$$tmp_file" "$$f"; \
done
@echo "Making deserialize_model public..."
@sed 's/__deserialize_model/deserialize_model/g' talon_one/api_client.py > talon_one/api_client.py.tmp && \
mv talon_one/api_client.py.tmp talon_one/api_client.py
@echo "Done.";